Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Electronics : Adding WIFI
Author | Message | ||||
Zibe Newbie Joined: 15/01/2018 Location: AustraliaPosts: 10 |
Hi all, I mentioned earlier I had code for making use of an ESP8266 to connect an Arduino based inverter etc (anything with serial etc.) to WIFI and datalog. Well here it is. Basically I took existing code from Mathew Forward (https://www.forward.com.au/pfod/CheapWifiShield/ESP2866_01_WiFi_Shield/index.html) and modified his serial webserver to take a ThingSpeak formatted string and automatically post it to ThingSpeak. I would suggest only connecting the Tx pin from your micro to the ESP8266. This is to prevent the ESP8266 overflowing the serial buffer of your micro incase it goes into a strange baud rate debugging mode (which can happen). More notes from my code: Code modified to create an easy to config serial to WiFi device for posting to ThingSpeak from an ESP8266. To use: create a serial connection at 9600 baud. Send fully formed ThingSpeak data string with a period no shorter than 15 seconds (ThingSpeak posting limit). An ending '~' determines the end of the string and triggers the ESP8266 to post. Note, a 30 second posting interval works well. Example, send 100.0 to ThingSpeak field1: field1=100.0~ Note: debugging information has been left in and will return the following results with the above post viewed in a serial monitor: field1=100.0 Client not connected and data ready Waiting for connection Connected and Data posted RSSI:-66 2018-11-21_055224_ESP8266_ThingSpeak_PostClient_0.1_1.zip Initially it create an AP (enter config mode). You connect to it using your PC or phone, enter in your AP name and password, your ThingSpeak account info and then save. It will then reboot, and connect your your WIFI AP and when you send the string over serial to it, it will post to ThingSpeak. To enter the config mode of the ESP8266 (e.g. have it generate its AP first time you will need to hold GPIO2 LOW when first booting the chip. Then look for "ThingSpeak Client" on your WIFI list. The password is PASS#1234#. |
||||
Zibe Newbie Joined: 15/01/2018 Location: AustraliaPosts: 10 |
Looks like this. |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
This is interesting to see. I had a quick look at the code and it looks to be a lot to get a few data points into a database. Thingspeak is looks easy and requires no hosting hassles. But I would roll my own based on a raspberry Pi and the USB serial link on the Nano/Uno. wronger than a phone book full of wrong phone numbers |
||||
nickskethisniks Guru Joined: 17/10/2017 Location: BelgiumPosts: 458 |
I like using thinkspeak because it is simple! And it will be enough for visualizing/ monitor inverter, battery and solar controller. |
||||
kentfielddude Regular Member Joined: 09/05/2019 Location: United StatesPosts: 89 |
I hear emoncms is pretty good. |
||||
BenandAmber Guru Joined: 16/02/2019 Location: United StatesPosts: 961 |
This is pretty awesome you guys come up with some really cool things And then you share them freely how awesome is that be warned i am good parrot but Dumber than a box of rocks |
||||
Print this page |