Post topics, source code that relate to the Arduino Platform

User avatar
By Lucas neill
#62683 Sorry I didn't see your added code before I reply your post. Thank you that's exactly what I want. I wonder now some details

1- the ap side sends the temperature data to thingspeak?
2- should I use write api or read api key?
3 - in the code, client side, the subnet is 4 but My home network is 1 so should I use 4 or 1?
Last edited by Lucas neill on Fri Feb 17, 2017 2:54 am, edited 1 time in total.
User avatar
By gdsports
#62684
1- the ap side sends the temperature data to thingspeak?

Yes. TS is very useful to get graphs and charts.

2- should I use write api or read api key?

write api key. Use the write key to write/put data to thingspeak. Use the read key to read/get data from thingspeak.

3 - in the code the subnet is 4 but My home network is 1 so should I use 4 or 1?

The client and AP are on the 192.168.4.x subnet. This subnet is separate from your WiFi router network. When the AP sends data to thingspeak it switches to STA mode so it gets a different IP address from your WiFi router using DHCP.
User avatar
By Lucas neill
#62710 I wish this is my last question. :D in ap codes what parts should I change according to my own information? For example api key , wifi said and password part and what else? 1-For the ssid part should I put my own network's ssid?
2-And there are sections with stars like(*********) which of them I must edit? 3-For example wifi.begin() has stars. It ll stay with stars or I must enter my ssid and password there?
User avatar
By gdsports
#62714 There are two sets of ssid/password. ESP-DHT has the DHT sensor and it must connect to ESP-AP. ESP-AP is an AP with its own ssid/password, different from your home wifi router ssid/password. When the ESP-AP sends data to thingspeak on the Internet, it must connect to your home wifi router so it must know that pair as well.

1-For the ssid part should I put my own network's ssid?

In the AP mode INO file look for the function setupStMode. Inside this function modify WiFi.begin() so it has the ssid/password of your home wifi router.

Code: Select allWiFi.begin("myhomessid", "myhomepassword");


2-And there are sections with stars like(*********) which of them I must edit?

In the AP mode INO file modify the following lines. The ssid must be different from your home router ssid.

Code: Select all// Internet router credentials
const char* ssid = "ESPAP";
const char* password = "ESPAPsecret";


The ESP-DHT client must connect to the ESP-AP so the ssid/password in the client program must match the ssid/password in the AP program.

Code: Select all// AP Wi-Fi credentials
const char* ssid = "ESPAP";
const char* password = "ESPAPsecret";


3-For example wifi.begin() has stars. It ll stay with stars or I must enter my ssid and password there?

Change the stars as described above.

I have never used these programs so this is just a best guess. You will just have to try and see if these changes work or not.