i have been following the book quite closely and have done everything up to module 5, i have not gone past a section till i have made sure everything is as the book says
connecting the esp8266 with Node-Red
have made sure i have the correct esp8266 board selected, even downloaded bling sketch to make sure, downloaded all the libraries needed, then downloaded the code but when i run the code the built in led stays on all the time and the serial monitor says;
14:27:08.773 -> Connecting to Wi-Fi…
14:27:13.328 -> Connected to Wi-Fi.
14:27:13.328 -> Connecting to MQTT…
14:27:13.328 -> Disconnected from MQTT.
14:27:15.329 -> Connecting to MQTT…
14:27:15.329 -> Disconnected from MQTT.
14:27:17.330 -> Connecting to MQTT…
14:27:17.330 -> Disconnected from MQTT.
14:27:18.674 -> Publishing on topic counter at QoS 1, packetId: 0Connecting to MQTT…
14:27:19.328 -> Disconnected from MQTT.
14:27:21.339 -> Connecting to MQTT…
any help is appreciated
(from the land down under)
What’s the ESP8266 board you’re using?
Does it have good access to Wi-Fi? Is it relatively close to your router?
The wifi is about 9 foot away is working ok i use it the garage to watch ESPN Sunday night football (Monday here)
the ESP8266 module is by Model Vendor ESP8266mod, ISM 2.4GHz, PA +25dBm, 802.11h/g/n
has silas cp2102 chip on board
Back of board says; NODEMCU
have just noticed it says to download CP2102 driver?? but it downloads the blink sketch ok and does run; ie on board led does blink
If the sketches uploaded fine, that’s because you already have those drivers installed.
Check if you need to update your ESP8266 boards in the Arduino IDE. Go to Tools > Board > Boards Manager and search for ESP8266. Then, check if there is a newer version to install.
Then, upload the code again.
Also, restart your Raspberry Pi with the following command:
Then, you need to wait a couple of minutes while it reboots.
After that, restart the ESP8266 and check if this time it’s working fine.
i have checked the board has the latest update installed, have rebooted the PI, have run WIFI scan to make sure it sees my wifi,
13:15:57.477 -> Starting Wi-Fi scan…
13:15:59.661 -> 5 networks found:
13:15:59.661 -> 00: [CH 01] [04:17:B6:40:90:0E] -79dBm * H
13:15:59.661 -> 01: [CH 06] [14:CC:20:E1:13:2E] -33dBm * V poppies
13:15:59.661 -> 02: [CH 06] [34:53:D2:FC:C4:A1] -87dBm * V Optus_A896F7
13:15:59.707 -> 03: [CH 01] [68:5A:CF:E9:89:27] -87dBm * V AndroidAP
13:15:59.707 -> 04: [CH 11] [3C:77:E6:25:35:55] -38dBm V SETUP
my WIFI is poppies, I’m going delete MQTT from the pi and reinstall and start again, thanks for the help I’m sure we’ll work it out, I’ll get back to you if I still need help
update I think I found the problem
Connecting to Wi-Fi…
13:49:01.395 -> Connected to Wi-Fi.
13:49:01.443 -> Connecting to MQTT…
13:49:01.580 -> Publish acknowledged.
13:49:01.580 -> packetId: 21584
13:49:01.627 -> Publish acknowledged.
13:49:01.627 -> packetId: 29556
13:49:01.627 -> Disconnected from MQTT.
this is what I see, not exactly as in the book
on page 152 (ESP8266-Code) line 21 says MQTT port 1883 elsewhere in the book it says 1880, so i changed the port to 1880 and this is now what I see, I think we’re getting there
It should be port 1883. But it seems it’s working better on port 1880… That’s not what I was expecting,
Are you using a Wi-Fi repeater? Sometimes those cause issues in MQTT connections…
Hi Sara, does look a bit better:
12:47:46.365 -> Connected to Wi-Fi.
12:47:46.365 -> Connecting to MQTT…
12:47:46.413 -> Connected to MQTT.
12:47:46.459 -> Session present: 0
12:47:46.459 -> Subscribing at QoS 2, packetId: 1
12:47:46.459 -> Publishing at QoS 0
12:47:46.459 -> Publishing at QoS 1, packetId: 2
12:47:46.459 -> Publishing at QoS 2, packetId: 3
12:47:46.459 -> Subscribe acknowledged.
12:47:46.459 -> packetId: 1
12:47:46.459 -> qos: 2
12:47:46.459 -> Publish acknowledged.
12:47:46.459 -> packetId: 2
12:47:46.646 -> Publish acknowledged.
12:47:46.646 -> packetId: 3
12:47:52.322 -> Publishing on topic counter at QoS 1, packetId: 4Publish acknowledged.
12:47:52.414 -> packetId: 4
12:48:02.291 -> Publishing on topic counter at QoS 1, packetId: 5Publish acknowledged.
12:48:02.339 -> packetId: 5
12:48:12.298 -> Publishing on topic counter at QoS 1, packetId: 6Publish acknowledged.
12:48:12.298 -> packetId: 6
I don’t know what I did, will have to write everything down in future, but it now seems to be working
P.S. now to see if i can get the flow right
Update: everything seems to be working ok, user interface shows exactly what is shown on page 174
all I remember doing was downloading the sketch again, putting all the essentials Wi-Fi pswd etc. then uploading to the ESP8266 all went ok, so weather I got a glitch downloading the first sketch, I don’t know, just happy all’s well and I can continue on with the book