Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:49 27 Nov 2024 Privacy Policy
Jump to

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: Australia
Posts: 10
Posted: 08:02pm 20 Nov 2018
Copy link to clipboard 
Print this post

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: Australia
Posts: 10
Posted: 10:24pm 20 Nov 2018
Copy link to clipboard 
Print this post

Looks like this.


 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 05:19am 21 Nov 2018
Copy link to clipboard 
Print this post

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: Belgium
Posts: 458
Posted: 11:33am 22 Nov 2018
Copy link to clipboard 
Print this post

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 States
Posts: 89
Posted: 01:58pm 15 Jul 2019
Copy link to clipboard 
Print this post

I hear emoncms is pretty good.
 
BenandAmber
Guru

Joined: 16/02/2019
Location: United States
Posts: 961
Posted: 08:52pm 15 Jul 2019
Copy link to clipboard 
Print this post

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


To reply to this topic, you need to log in.

© JAQ Software 2024