phracturedblue / esp8266mqttmesh Goto Github PK
View Code? Open in Web Editor NEWSelf-assembling Mesh network built around the MQTT protocol supporting OTA
License: GNU General Public License v3.0
Self-assembling Mesh network built around the MQTT protocol supporting OTA
License: GNU General Public License v3.0
Hi, i thinking about joining this two majestic project. As I google around ESP8266 and mesh and mysensors i found your post on their forum. Is that last state ? Or you have some progress with connecting your amazing project with mysensors ?
Description of problem:
When i bring a fresh new node near an existing esp mesh, first it scans for mesh APs.
It will get multiple APs and sort them by RSSI.
After a successful connection, that node gets connected to one of the scanned Mesh APs.
Now, suppose that particular AP goes down(The one to which the new node had connected based on best RSSI).
That node will suffer a disconnection and then in the onWifiDisconnect() callback function it will move to the next AP in the sorted RSSI list. It attempts wificonnection to it which is successful.
But when it attempts a TCP Connection using the following statement in the onWifiConnect() callback
espClient[0]->connect(WiFi.gatewayIP(), mesh_port);
But the connection is not successful.
Something is wrong here.
When this node lost connection to its previous AP, it was able to successfully disconnect its wifi connection but something is wrong with the socket. The socket is still associated with the previous AP.
Following is the Serial Monitor log:-
[scan] Found: 11
[scan] Found SSID: '' BSSID '9A:A4:16:8A:64:1B' RSSI: -24
[scan] Found SSID: 'StartHub_Basement_AP1' BSSID 'D8:38:0D:1D:9F:C1' RSSI: -70
[scan] Did not match SSID list
[scan] Found SSID: '' BSSID '1A:7C:C6:43:97:9C' RSSI: -24
[scan] Found SSID: '' BSSID 'D2:55:45:43:92:9B' RSSI: -15
[scan] Found SSID: 'EponWifi' BSSID '38:94:E0:00:10:28' RSSI: -86
[scan] Did not match SSID list
[scan] Found SSID: 'oye hello' BSSID 'C2:9F:05:76:BB:54' RSSI: -62
[scan] Did not match SSID list
[scan] Found SSID: 'StarthubGF 1' BSSID '60:E3:27:CB:FA:90' RSSI: -54
[scan] Did not match SSID list
[scan] Found SSID: 'StarthubTPlinkGroundFloor' BSSID '10:FE:ED:6D:0A:88' RSSI: -68
[scan] Did not match SSID list
[scan] Found SSID: 'Soft Scouts WOW' BSSID '14:CC:20:51:C9:74' RSSI: -81
[scan] Did not match SSID list
[scan] Found SSID: 'StartHub_GF_AP1' BSSID 'D8:38:0D:1D:9F:71' RSSI: -65
[scan] Did not match SSID list
[scan] Found SSID: 'Connectify-28' BSSID '62:67:20:9F:9A:1C' RSSI: -62
[scan] Did not match SSID list
[connect] 0 * D2:55:45:43:92:9B -15 RSSI Sorted
[connect] 1 9A:A4:16:8A:64:1B -24
[connect] 2 1A:7C:C6:43:97:9C -24
[connect] Connecting to SSID : 'esp8266_mqtt_mesh_43929b' BSSID 'D2:55:45:43:92:9B' Attempting
[onWifiConnect] Connecting to mesh: 192.168.2.1 on port: 1884 Successful Connect. Attemp TCP
[onConnect] Connected to mesh Successful TCP
[publish] Sending: esp8266-out/bssid/14cadb=42:1B:C5:14:CA:DB
[setup_AP] Initialized AP as 'esp8266_mqtt_mesh_14cadb' IP '192.168.3.1'
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 0
[onAck] Got ack on 192.168.2.1: 98 / 494
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 1
[onAck] Got ack on 192.168.2.1: 54 / 495
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 2
[onAck] Got ack on 192.168.2.1: 54 / 394
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 3
[onError] Got error on 0.0.0.0: -13 AP Shut Down
[onDisconnect] Disconnected from the mesh AP. Socket Disconnected
[onWifiConnect] Connecting to mesh: 0.0.0.0 on port: 1884
[onWifiDisconnect] Disconnected from Wi-Fi: because: 200
[schedule_connect] Scheduling reconnect for 5.00 seconds from now
[connect] 0 D2:55:45:43:92:9B -15
[connect] 1 * 9A:A4:16:8A:64:1B -24 Moved to next AP in RSSI List
[connect] 2 1A:7C:C6:43:97:9C -24
[connect] Connecting to SSID : 'esp8266_mqtt_mesh_8a641b' BSSID '9A:A4:16:8A:64:1B'
[onWifiConnect] Connecting to mesh: 192.168.2.1 on port: 1884 Successful Connect. Attemp TCP
[onError] Got error on 0.0.0.0: -13 Unsuccessful TCP Connection
[onDisconnect] Disconnected from the mesh AP.
[onWifiConnect] Connecting to mesh: 0.0.0.0 on port: 1884
[onWifiDisconnect] Disconnected from Wi-Fi: because: 8
[schedule_connect] Scheduling reconnect for 5.00 seconds from now
[connect] 0 D2:55:45:43:92:9B -15
[connect] 1 9A:A4:16:8A:64:1B -24
[connect] 2 * 1A:7C:C6:43:97:9C -24 Moved to next AP in RSSI List
[connect] Connecting to SSID : 'esp8266_mqtt_mesh_43979c' BSSID '1A:7C:C6:43:97:9C'
[onWifiConnect] Connecting to mesh: 192.168.2.1 on port: 1884 Successful Connect. Attemp TCP
[onError] Got error on 0.0.0.0: -13
[onDisconnect] Disconnected from the mesh AP.
[onWifiConnect] Connecting to mesh: 0.0.0.0 on port: 1884
[onWifiDisconnect] Disconnected from Wi-Fi: because: 8
[schedule_connect] Scheduling reconnect for 5.00 seconds from now
Either scanning was ON or ap_ptr was at the End!
[scan] Scanning for networks Scan starts. By now that initial AP is turned On
[schedule_connect] Scheduling reconnect for 1.00 seconds from now
[schedule_connect] Scheduling reconnect for 1.00 seconds from now
[schedule_connect] Scheduling reconnect for 1.00 seconds from now
[scan] Found: 13
[scan] Found SSID: 'StartHUB_ 1' BSSID 'E8:CC:18:9D:96:30' RSSI: -67
[scan] Did not match SSID list
[scan] Found SSID: 'trecker' BSSID '46:03:2C:BC:4F:8F' RSSI: -65
[scan] Did not match SSID list
[scan] Found SSID: 'StartHub_Basement_AP1' BSSID 'D8:38:0D:1D:9F:C1' RSSI: -68
[scan] Did not match SSID list
[scan] Found SSID: '' BSSID '1A:7C:C6:43:97:9C' RSSI: -19
[scan] Found SSID: '' BSSID 'D2:55:45:43:92:9B' RSSI: -15
[scan] Found SSID: 'EponWifi' BSSID '38:94:E0:00:10:28' RSSI: -90
[scan] Did not match SSID list
[scan] Found SSID: '' BSSID '9A:A4:16:8A:64:1B' RSSI: -23
[scan] Found SSID: 'oye hello' BSSID 'C2:9F:05:76:BB:54' RSSI: -59
[scan] Did not match SSID list
[scan] Found SSID: 'StarthubGF 1' BSSID '60:E3:27:CB:FA:90' RSSI: -62
[scan] Did not match SSID list
[scan] Found SSID: 'StarthubTPlinkGroundFloor' BSSID '10:FE:ED:6D:0A:88' RSSI: -75
[scan] Did not match SSID list
[scan] Found SSID: 'Soft Scouts WOW' BSSID '14:CC:20:51:C9:74' RSSI: -92
[scan] Did not match SSID list
[scan] Found SSID: 'StartHub_GF_AP1' BSSID 'D8:38:0D:1D:9F:71' RSSI: -73
[scan] Did not match SSID list
[scan] Found SSID: 'Connectify-28' BSSID '62:67:20:9F:9A:1C' RSSI: -61
[scan] Did not match SSID list
[connect] 0 * D2:55:45:43:92:9B -15 <- found that initial AP
[connect] 1 1A:7C:C6:43:97:9C -19
[connect] 2 9A:A4:16:8A:64:1B -23
[connect] Connecting to SSID : 'esp8266_mqtt_mesh_43929b' BSSID 'D2:55:45:43:92:9B'
[onWifiConnect] Connecting to mesh: 192.168.2.1 on port: 1884
[onConnect] Connected to mesh Successful TCP Connection!!!!!!!
[publish] Sending: esp8266-out/bssid/14cadb=42:1B:C5:14:CA:DB
[setup_AP] Initialized AP as 'esp8266_mqtt_mesh_14cadb' IP '192.168.3.1'
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 4
[publish] Sending: esp8266-out/14cadb/1362651=hello from 1362651 cnt: 5
Something is wrong with the espClient[0].
It is still associated with the previous AP.
Kindly look into it.
THis has brought my work to a halt.
How to publish retain messages to mqtt broker ?
I can't see any parameter available in "mesh.publish" to retain messages on mqtt broker.
Hello, if i upload the Programm once with ota, I can't upload it a second time, only after restarting the Module.
It seems that after rebooting from OTA the Module connects to the mqtt broker and still sends his massages, but when i try to update the software again over ota, then just nothing happens, the packets are getting sendet from the python script but the esp8266 does not receive anything.
All my Software Versions are the Newest that PlatformIO has to offer.
New to this library, I installed the prerequisites and tried the hello world example. It connected to WiFi, but failed to connect to the MQTT server, spraying the serial port with connecting...disconnected messages.
To cut a long story short, the solution was to add a line after line 72 of ESP8266MQTTMesh.cpp:
mqtt_port(mqtt_port),
Is here a small chance to use GSM. I mean, choose between GSM (like i SIM800C, or directly TinyGSM) and Wifi (not changing it alive druing run, but maybe before compiling) ? Because sometime, is Wi-Fi connection unreachable in battery stuff. And your part in creating mesh is perfect. As i can see in tinyGSM examples... they object of modem and connection act similiar to ESP8266Wifi
TinyGsm modem(SerialAT);
TinyGsmClient client(modem);
PubSubClient mqtt(client);
and
WiFiClient espClient;
PubSubClient client(espClient);
and than works like i normal ESP on WiFi. I know, that you dont use pubsub, but asyncmqtt, and i dont know it structure :)
Thank you for reply and help
I am using the latest version of ESP8266MQTTMesh Library and arduino for uploading the code.
How do I subscribe to a topic and use call back function? Please Help
please give an example of callback and subscribe topic if possible.
Using platformio and the following libraries:
Description:
I am trying the ESP8266MeshHelloWorld example and after uploading to a NodeMCU 1.0 board I get WifiConnection successfull but then when connecting to my mosquitto server on 1883 i see the following loop:
[connect_mqtt] Attempting MQTT connection...
[onMqttDisconnect] Disconnected from MQTT.
[connect_mqtt] Attempting MQTT connection...
[onMqttDisconnect] Disconnected from MQTT.
[connect_mqtt] Attempting MQTT connection...
[onMqttDisconnect] Disconnected from MQTT.
[connect_mqtt] Attempting MQTT connection...
[onMqttDisconnect] Disconnected from MQTT.
I have tried the AsyncMQTTExample and it works just fine connecting to my mosquitto server
I have tried both ESP Core 1.3.1 and Stage versions
Any ideas what I am doing wrong?
Hi @PhracturedBlue, would it be possible to integrate https://github.com/tzapu/WiFiManager into this?
It would be awesome if we could set the wifi credentials on one device and let it share those over the mesh to all other clients.
I've been looking into it a bit, but this fairly outside my comfort zone - being a mobile/fullstack dev.
Thanks a lot in advance!
In your latest send_ota.py is error when i run it with Python 3.6.3
Updating firmware on the following nodes:
805de
Traceback (most recent call last):
File "ota.py", line 201, in <module>
main()
File "ota.py", line 197, in main
send_firmware(client, data, [args.node] if args.node else [])
File "ota.py", line 97, in send_firmware
client.publish("{}{}".format(send_topic, str(pos)), b64d)
File "D:\WinPython-64bit-3.6.3.0Qt5\python-3.6.3.amd64\lib\site-packages\paho\
mqtt\client.py", line 871, in publish
raise TypeError('payload must be a string, bytearray, int, float or None.')
TypeError: payload must be a string, bytearray, int, float or None.
when i in send firmware function change in client.publish b64d to b64d.decode(), it will stuck on
Updating firmware on the following nodes:
805de
1 node(s) missed the message, retrying
1 node(s) missed the message and no retires left
1 node(s) missed the message and no retires left
i have latest version of library on that device wich i update
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
Latest version of all
Description of problem:
When attempting to define GATEWAY_ID in the example hello world mesh project. It doesn't seem to work such to force the nodes to avoid connecting to wifi that do not match that ID.
#ifndef GATEWAY_ID
#define GATEWAY_ID 146743
#endif
Continuing this issue #18
Description of problem:
Despite succeeding to delay the broker IP set, when I tried to set the callback as i used to before this fix and testing it in the ESP I am getting this error:
Exception (9):
epc1=0x4020dfb5 epc2=0x00000000 epc3=0x00000000 excvaddr=0xfe090016 depc=0x00000000
ctx: sys
sp: 3ffffaa0 end: 3fffffb0 offset: 01a0
stack>>>
3ffffc40: 3fff03cc 000006da 000006da 3fff03cc
3ffffc50: 00000010 3ffffce0 00000000 4010053d
3ffffc60: 00000034 000036d0 000006da 3fff1f18
3ffffc70: 00000030 00000001 3ffe863e 402111cc
3ffffc80: 00000010 fe090016 00000000 4020e080
3ffffc90: 3fff362c 00000047 3ffef1f4 40201651
3ffffca0: 3fff03cc 3fff1f18 3fff1c48 402094fc
3ffffcb0: 3fff362c 3fff1c44 00000001 40209648
3ffffcc0: 3ffe90e2 3fff1c44 3ffffcf8 3ffffcf8
3ffffcd0: 3fff362c 3fff1c44 3fff1f18 4020c19f
3ffffce0: 00000000 00000000 00000000 00000000
3ffffcf0: 00000000 00000000 00000000 00000000
3ffffd00: 00000000 00000000 00000000 00000000
3ffffd10: ffffffff 00000000 3ffe9b01 00000008
3ffffd20: 40213a32 3ffed120 3fff0ccc 00000000
3ffffd30: 00000000 3fff173c 00000000 4020c1dd
3ffffd40: 00000000 00000000 00000020 40201e70
3ffffd50: 3f000000 40212e87 3ffed120 40208b87
3ffffd60: 3f000000 3fff172c 00000000 402118c2
3ffffd70: 00000002 00000000 00000000 4020f8c4
3ffffd80: 00000000 40222edc 3fff427e 3fff4244
3ffffd90: 3fff1444 3fff1584 40208b64 4020c1bc
3ffffda0: 3f000000 000001e8 000001e8 00000002
3ffffdb0: 3fff174c 3fff362c 00000000 3ffedb30
3ffffdc0: 401009c2 00000001 00000000 00000000
3ffffdd0: 3ffea2d6 00000026 3fff4244 40211781
3ffffde0: 00000000 00000000 00000000 00000000
3ffffdf0: 00000005 00000000 00000020 40210c14
3ffffe00: 00000000 00000000 00000000 00000000
3ffffe10: 40101b41 00000026 3fff4244 40210cb9
3ffffe20: 00007fff 00000026 3fff1ce4 4020f6b9
3ffffe30: 3fff1b04 00000000 4020ea84 402116f0
3ffffe40: 3fff13fc 05bb82b2 4020ea3c 40211748
3ffffe50: 00000026 3ffea230 3ffea230 00000001
3ffffe60: 3fff1e51 3fff4244 4000050c 3fffc278
3ffffe70: 40229a8d 05bb82b2 00000000 3fff1d38
3ffffe80: 00000001 3fff13e4 3fff1ce4 4020f6ec
3ffffe90: 3ffea23c 3fff0ce4 3fff1ce4 4020e2e8
3ffffea0: 3fff1584 00000030 0000000f ffffffff
3ffffeb0: 3fff0af0 3fff0af8 00000006 3fff09b8
3ffffec0: 3fff1584 3fff09c0 3fff09bc 4020e33b
3ffffed0: 3fff1584 3fff09c0 3fff09bc 40226d10
3ffffee0: 00000026 6a01a8c0 00000018 00000026
3ffffef0: 00000018 00000000 3ffec20d 40107404
3fffff00: 40220000 00000000 0000007d 3fff0af4
3fffff10: 3ffea2ae 3fff0af8 3fff13e4 40224101
3fffff20: 3fff08c0 3fff144c 3fff144c 3ffeea40
3fffff30: 00000000 3fff13e4 0000001c 3fff144c
3fffff40: 3ffea2a0 00000000 3fff13e4 402234f9
3fffff50: 3201a8c0 00000074 00000000 00000041
3fffff60: 00000002 0000001a 40213343 3ffed3f0
3fffff70: 3ffea280 3fffdcc0 3ffe99f0 3ffe99f0
3fffff80: 402132b6 3ffed3f0 00000000 3fff14d4
3fffff90: 3fffdc80 00000000 3fff13e4 4021c287
3fffffa0: 40000f49 3fffdab0 3fffdab0 40000f49
<<<stack<<<
ets Jan 8 2013,rst cause:1, boot mode:(1,7)
ethets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset
I am referencing the callback at the top as all variables void callback(const char *topic, const char *msg);
And then implementing it below:
void callback(const char *topic, const char *msg) {
// topic is the command and msg the payload
Serial.println(topic);
Serial.println(msg);
}
This used to work before the fix in the issue. How should I declare the callback to make it global if it is not?
When the setup up finishes and the esp8266 matches the SSID the hardware wdt reset is activated. I have implemented ESP.wdtDisable() (in setup) to give it more time to connect but still get the same problem.
Serial monitor output: https://pastebin.com/TxpqwVqJ
I have tried multiple AP's and double checked the login credentials but get the same error for all.
Latest PlatformIO
Hello, how to use proper SSL ? I try it in ESP8266MeshHelloWorld.ino
I have properly installed Mosquito and defined my letsencrypt certificate
when i use:
mosquitto_sub -h mqtt.MYPAGE.com -t "#" -p 8883 --cafile /etc/ssl/certs/ca-bundle.crt -u "someuser" -P "somepassword"
mosquitto_pub -h mqtt.MYPAGE.com -t test -m "hello again" -p 8883 --cafile /etc/ssl/certs/ca-bundle.crt -u "someuser" -P "somepassword"
everything is OK
i generate SSL fingerprint in this format:
const uint8_t MQTT_FINGERPRINT[] = {0x92,0xd3,0x90,0x57,0x56,0xd9,0x02,0x29,0x45,0x0f,0x1a,0x3c,0xb6,0x77,0x78,0xdb,0x78,0xe3,0x1c,0x02};
and of cource enabled SSL:
#define MQTT_SECURE true
everything compiled and uploaded OK
but node show only this:
[onMqttDisconnect] Disconnected from MQTT: 5
[connect_mqtt] Attempting MQTT connection (something:8883)...
[onMqttDisconnect] Disconnected from MQTT: 0
[connect_mqtt] Attempting MQTT connection (something:8883)...
[onMqttDisconnect] Disconnected from MQTT: 5
[connect_mqtt] Attempting MQTT connection (something:8883)...
[onMqttDisconnect] Disconnected from MQTT: 0
[connect_mqtt] Attempting MQTT connection (something:8883)...
and after few attempts show stacktrace...
Decoding 49 results
0x40220f32: more_comps at crypto/bigint.c line 672
0x40221c32: bi_divide at crypto/bigint.c line 430
0x40221ef5: bi_set_mod at crypto/bigint.c line 774
0x40220fd8: trim at crypto/bigint.c line 672
0x402230b1: RSA_pub_key_new at crypto/rsa.c line 255
0x40226db5: asn1_get_big_int at ssl/asn1.c line 169
0x40227429: asn1_public_key at ssl/asn1.c line 556
0x402272b5: asn1_get_printable_str at ssl/asn1.c line 470
: (inlined by) asn1_name at ssl/asn1.c line 502
0x40227156: asn1_validity at ssl/asn1.c line 410
0x4021f07e: x509_new at ssl/x509.c line 128
0x402262f1: SHA256_Final at crypto/sha256.c line 273 (discriminator 3)
0x402226c0: hmac_sha256_v at crypto/hmac.c line 165
0x4023895b: pp_attach at ?? line ?
0x402389aa: pp_attach at ?? line ?
0x40238ab6: pp_attach at ?? line ?
0x40100e2e: pp_post at ?? line ?
0x40237a77: ppTxPkt at ?? line ?
0x4022bc5b: ieee80211_output_pbuf at ?? line ?
0x402491c4: etharp_send_ip at netif/etharp.c line 435
0x40100e2e: pp_post at ?? line ?
0x40104233: lmacRxDone at ?? line ?
0x40101b49: trc_NeedRTS at ?? line ?
0x40101d1e: trc_NeedRTS at ?? line ?
0x4010215e: wDev_ProcessFiq at ?? line ?
0x4021b340: sntp_get_current_timestamp at core/sntp.c line 630
0x4023895b: pp_attach at ?? line ?
0x4021cb35: process_certificate at ssl/tls1.c line 2007
0x4021e2d2: do_clnt_handshake at ssl/tls1_clnt.c line 107
0x4010020c: _umm_free at umm_malloc.c line ?
0x4020469a: ax_port_read at ?? line ?
0x4021dd1c: do_handshake at ssl/tls1.c line 2007
: (inlined by) basic_read at ssl/tls1.c line 1483
0x4021c54d: add_packet at ssl/tls1.c line 2007
0x40100688: free at ?? line ?
0x4021de84: ssl_read at ssl/tls1.c line 2007
0x40204435: tcp_ssl_read at ?? line ?
0x4020393f: AsyncClient::_recv(tcp_pcb*, pbuf*, long) at ?? line ?
0x4024806e: tcp_output at core/tcp_out.c line 925
0x40203968: AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, long) at ?? line ?
0x4024d124: tcp_input at core/tcp_in.c line 394 (discriminator 1)
0x40106a5c: pvPortMalloc at ?? line ?
0x40210000: spiffs_object_truncate at ?? line ?
0x4024a3a9: ip_input at core/ipv4/ip.c line 559
0x402497ad: ethernet_input at netif/etharp.c line 1379
0x4010494a: wdt_feed at ?? line ?
0x4023e46c: ets_timer_handler_isr at ?? line ?
0x4023e492: ets_timer_handler_isr at ?? line ?
0x402427df: system_get_sdk_version at ?? line ?
and my broker show this:
1512420001: Socket error on client , disconnecting.
1512420001: New connection from 1.2.3.4 on port 8883.
1512420002: Socket error on client , disconnecting.
1512420002: New connection from 1.2.3.4 on port 8883.
1512420002: Socket error on client , disconnecting.
1512420002: New connection from 1.2.3.4 on port 8883.
After the OTA update the Module kind of restarts and logs in to the mqtt server, but then the mqtt Server throws an error:
Client error [esp8266257bd0]: Error: read ECONNRESET
Closed because of error
in this state the Module is still able to post data, but it seems to no longer be in the receiver list.
Cause this issue it also is no longer possible to do OTA Programming a second time.
After restarting the Module everything is working fine again.
I would really be intrested where these error is comming from.
To reproduce it jou can just try to do 2 OTA Updates without restarting the ESP in between.
By the way, u did a verry great job!
Congratulation to 1.0.0 version :)
I see lot of rewrite, not only about SPIFFS but about identification and mesh comunication.
Can you explain in short how it work for now ?
i see, that only broker store IDs.
but what happend when i start node without wifi range in mesh ?
what happend when i change ID of node on broker ? (i last version Node adopt new ID and instantly change it).
Can you please write all new stuff ? or what you change :)
thank you for your work
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
Are you using platformio or Arduino?
Yes
I'm trying the Hello World example but the callback function never is called. I receive the "hello" message via my mosquitto broker and I tried to send all kind of topics to Sonoff Basic ESP8266. I'm using the GPIO 13 as it is used on this version. I changed the helloworld code (added just one line) to send a Serial.println() whenever I receive a topic on my ESP (before match the topic), but the print never comes.
Some topics that I used:
topicin/ESPID/
ESPID/
topicout/ESPID/
topicin/mesh-id/ESPID
Could someone help me?
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
Are you using platformio or Arduino?
Description of problem:
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
If you are you using platformio or Arduino, which one?
Arduino
Description of problem:
I'm using the "HelloWorld" example, I get the following on the serial monitor:
[connect_mqtt] Attempting MQTT connection (192.168.1.179:1883)...
[onMqttConnect] MQTT Connected
[publish] Sending: esp8266-out/bssid/a1e097=6A:A6:E6:A1:E0:97
[setup_AP] Initialized AP as 'esp8266_mqtt_mesh_a1e097' IP '10.42.1.1'
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 76
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 77
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 78
[onMqttDisconnect] Disconnected from MQTT: 0
[connect_mqtt] Attempting MQTT connection (192.168.1.179:1883)...
[onMqttConnect] MQTT Connected
[publish] Sending: esp8266-out/bssid/a1e097=6A:A6:E6:A1:E0:97
[setup_AP] Initialized AP as 'esp8266_mqtt_mesh_a1e097' IP '10.42.1.1'
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 79
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 80
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 81
[publish] Sending: esp8266-out/a1e097/10608791=hello from 10608791 cnt: 82
It seems that the mqtt server can be published, but I do not see the messages coming to my server,
I appreciate your collaboration.
Apologies for my English, I'm using the Google translator
Hello,
is there any option to stop scanning (maybe only first time) and only connect to predefined Wifi ? I'm trying to make battery module with this library and this proces take too much time.
Hi @PhracturedBlue, thanks for your contribution on MQTT over Mesh for ESP. Do you have plan to have TLS support on this project? Thanks again. Lewis
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
If you are you using platformio or Arduino, which one?
platformio
Description of problem:
Using example code - just configured mqtt server and networks.
And esp32 proceed trying to connect to existing NETGEAR02 router
But always getting 201 reason. Such loop can last for an half an hour of retries or more.
Reboot, reset, reupload - do not help.
Very similar to here espressif/esp-idf#724
[schedule_connect] Scheduling reconnect for 0.50 seconds from now
[scan] Found: 13
[scan] Found SSID: 'NETGEAR02' BSSID '24:44:27:B5:C8:28' RSSI: -54
[match_networks] Comparing NETGEAR02
[match_networks] Matched
[scan] Found SSID: 'HUAWEI-QJ7k' BSSID '24:44:27:AF:E5:08' RSSI: -65
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'HUAWEI-8ck4' BSSID '24:44:27:B5:FC:28' RSSI: -65
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: '107' BSSID '70:72:3C:06:80:FC' RSSI: -67
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'Krival' BSSID '24:44:27:B4:2C:54' RSSI: -77
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'HUAWEI-pVu7' BSSID '24:44:27:99:CD:B0' RSSI: -81
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'Wi-fi (90)' BSSID '48:D5:39:68:52:6C' RSSI: -84
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'HUAWEI-7jtU' BSSID '24:44:27:B4:33:D8' RSSI: -88
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'office_rat_f_off_guest' BSSID '02:7B:EF:60:35:2C' RSSI: -89
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'office_rat_f_off' BSSID '10:7B:EF:60:35:2C' RSSI: -91
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'MIH' BSSID 'AC:61:75:9E:3E:88' RSSI: -91
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'HUAWEI-cG4f' BSSID '24:44:27:99:C6:0C' RSSI: -94
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[scan] Found SSID: 'HUAWEI-q5Jf' BSSID 'AC:61:75:85:11:AC' RSSI: -96
[match_networks] Comparing NETGEAR02
[match_networks] Comparing NETGEAR03
[match_networks] Comparing EPBYMINW3529
[scan] Did not match SSID list
[connect] 0 * 24:44:27:B5:C8:28 -54
[connect] Connecting to SSID : 'NETGEAR02' BSSID '24:44:27:B5:C8:28'
[onWifiDisconnect] Disconnected from Wi-Fi: NETGEAR02 because: 201
[schedule_connect] Scheduling reconnect for 5.00 seconds from now
[scan] Scanning for networks
Is there a way to run this code on a ESP32 based device?
Description
I've been unable to connect a node to another, through the hidden mesh network.
In my setup I have two nodes, one is connected to the router, and the other doesn't have the router on the network list, so I could try the mesh connection. They have the HelloWorld example loaded.
The node that is not connect to the router scans for networks, tries to connect to the mesh network, but it fails with reason 201 (NO_AP_FOUND).
Is the procedure for connecting to hidden networks the same as not hidden ones, don't they need the bssid? Also, hows does the library uses the files at /bssid/? Are they records of hidden networks that could be mesh networks? Are they only written after receiving a publish at IN_TOPIC/bssid?
Hello again,
if i try use DeepSleep, sometime its work sometime not ....
if (0 == strcmp(topic, (const char*) sleep.c_str())) {
val = atoi(msg);
//Serial.printf("i am in IF for slep");
if(val > 0) {
ESP.deepSleep(val * 1000000);
delay(500);
}
}
if i have uncommented Serial.print, deepsleep work correctly (delay on the end is the same story, without it deepsleep crash)
but if i dont have Serial.print or i have some delay deepsleep crash again
[onMqttMessage] Message arrived [esp8266-in/mesh_esp8266-1/sleep] '60'
[onMqttDisconnect] Disconnected from MQTT: 0
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld
EDIT: okey, in higher numbers of sleep, it will crash with Serial.print either
ESP8266MQTTMesh version: 0.8.1
AsyncMQTTClient version: 0.8.1
ESPAsyncTCP version: 1.0.1
ESP8266 Core version: 2.3.0
Arduino version : 1.8.3
Description
I'm trying to test ESP8266MeshHelloWorld.ino configure the credentials but I only get restart in the esp someone could help me
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v04c11db7
~ld
⸮
Exception (28):
epc1=0x4000bf80 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: cont
sp: 3fff1a30 end: 3fff1c80 offset: 01a0
stack>>>
3fff1bd0: 0000001c 00000000 3fff0b94 401004d8
3fff1be0: feefeffe feefeffe 3fff2c74 40201f95
3fff1bf0: 00000000 00000001 feefeffe feefeffe
3fff1c00: feefeffe feefeffe feefeffe 0001c200
3fff1c10: 0000001c 00000000 3fff0b94 40208648
3fff1c20: 00000000 00000000 00000000 00000000
3fff1c30: 40206adc feefeffe feefeffe 3fff0c50
3fff1c40: 3fffdad0 3ffef090 3fff0b94 40206bc8
3fff1c50: 40206adc feefeffe 4021147c 40211464
3fff1c60: feefeffe 00000000 3fff0c48 40210544
3fff1c70: feefeffe feefeffe 3fff0c60 40100718
<<<stack<<<
When i suddenly take out or switch off the mesh Gateway, the nodes still keep showing a valid connection for sometime.
How to reduce that time?
Keep Alive time or something like that needs to be reduced
Hi,
Tried the latest code and noticed it could not connect to configured ssid.
looked in to the code and noticed that index of WiFi.SSID() missing in ESP8266MQTTMesh line 303 for ESP8266MQTTMesh::scan() function.
Changed it to if (IS_GATEWAY) { network_idx = match_networks(WiFi.SSID(i).c_str(), WiFi.BSSIDstr(i).c_str()); }
and it is working.
When I connected all the esp's to the same AP as my broker, everything works and I receive messages from all the esp's.
However, when I set GATEWAY_ID in my platformio.ini file to test with the AP still in range, the esp's still connect to the AP. I have connected all the esp's to the broker at least once, and have restarted them after connecting them to the broker on the AP with the GATEWAY_ID already set, but they continue connecting to the AP directly.
I've added GATEWAY_ID to my platformio.ini file, as shown below:
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
GATEWAY_ID = 2862868
Am I doing something wrong in my implementation?
Hello,
Are there any thoughts to implementing MQTT's understanding of Quality of Service?
This should make actions like updating firmware much more robust, if client and broker both select QoS 2.
This might actually make it faster, by eliminating the current delay between data chunks
time.sleep(0.2)
in send_ota.py
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
If you are you using platformio or Arduino, which one?
platformio
Description of problem:
Getting compile issues:
Compiling .pioenvs/nossl/src/ESP8266MeshHelloWorld.ino.o
/Users/xxxxx/repos/ESP8266MQTTMesh/examples/ESP8266MeshHelloWorld/src/ESP8266MeshHelloWorld.ino:30:25: error: 'OUT_TOPIC' was not declared in this scope
const char *out_topic = OUT_TOPIC;
^
/Users/xxxxx/repos/ESP8266MQTTMesh/examples/ESP8266MeshHelloWorld/src/ESP8266MeshHelloWorld.ino:31:24: error: 'IN_TOPIC' was not declared in this scope
const char *in_topic = IN_TOPIC;
^
Sorry for the probably stupid question, but I am trying to learn MQTT.
Let's say that I have three ESP8266s in a mesh using your firmware.
#1 is a motion sensor
#2 is a water sensor
#3 has a RGB Led on it
Is a MQTT broker required for the three of them to talk? I would like when #1 triggers motion, #3 lights the LED red, and if #2 detects water, #3 lights the LED blue. I have a high level understanding of how this would work with the broker, but is a broker required?
Also, I meant to mention. Thank you for releasing this, and making it so easy for the rest of us. I am learning a lot with your project!
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
Description of problem:
On Arduino IDE I could not install the library correctly as installing from ZIP resulted in "file does not contain a valid library".
Is there a manual way to do that?
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
If you are you using platformio or Arduino, which one?
Description of problem:
The following code has been taken from scan() function.
I have doubts in the two statements marked BOLDLY .
//sort by RSSI
ap_t *ap_last = NULL;
for(ap_ptr = ap; ap_ptr != NULL; ap_last = ap_ptr, ap_ptr = ap_ptr->next) {
if(network_idx >= 0) {
//AP is Wifi AP
if (ap_ptr->ssid_idx != NETWORK_MESH_NODE && rssi <= ap_ptr->rssi) {
continue;
}
} else {
//AP is mesh node
if (ap_ptr->ssid_idx != NETWORK_MESH_NODE || rssi <= ap_ptr->rssi) {
continue;
}
}
next_ap->next = ap_ptr->next;
ap_ptr->next = next_ap;
break;
}
if (! ap_ptr) {
//Didn't insert this AP, so add it to the end;
next_ap->next = NULL;
if (ap_last) {
ap_last->next = next_ap;
} else {
ap = next_ap; // Itself is the only ap_t
}
}
Shouldn't these statements be:
next_ap->next = ap_ptr;
ap_last->next = next_ap;
Is any way to connect Node to wifi with hidden SSID ?
How does one configure the GATEWAY_ID so that not all the nodes have to be directly connected to the AP.
Description
I've been trying to get the HelloWorld example to work, only 1 node, and for that I have a mosquitto broker on my PC.
The example works fine up to the connection to the mqtt broker. Right after connecting, the subscription to IN_TOPIC and the publishings to OUT_TOPIC, executed at onMqttConnect() as well as the timed publishings are not making it to the broker. Some seconds later onWifiDisconnect() is called. After that it's just a cycle of connecting to the broker and disconnecting from the WiFi.
What I could figure out was that the setup_AP() call is causing this, more specifically the lines for setting up the node as Access point and Station.
Hello,
I'm looking to put together an example for OTA upload over the mesh, and would happily submit a pull request with a tutorial on setting up the network and doing updates.
Would you mind sharing what your thoughts are for architecture for pushing OTA updates over the mesh network? It's mentioned in the Readme, but never really shown in the code (that I can see anyway ;)
Thanks!
hellou, i try to figure out how detect unsuccesfull scanning. My problem in my battery application is, when wifi is not connected then node try connect forever and battery drain so much, because MQTT broker handle sleeping. I cannot access your private variables, than i asking you, what you recommend to detect scanning cycles .... I want to pass 1-2 scan of WiFi than deepsleep for a while. Thank you
Hi,
My issue is previous from the current usage, but is very nice to understand prior to go live.
In this scenario:
MQTT Broker Sever is: https://www.cloudmqtt.com
Router is: 192.168.1.254
Chanel is: 1
SSID is: trythisrouter
PASSWD: is: routerisfine
There will be 10 ESP8266 to test.
4 are Wemos Mini D1 with 2 relay in each
6 are Wemos D1 R2 with 3 relays in each
Our scenario is to deploy those ESP all around to test the MESH and have all log/debug enable to trace.
Please advise how the ESP8266 could be setup with ESP8266MQTTMesh
Thanks
Is there a posibility to integrate this mesh library with something like https://github.com/tzapu/WiFiManager to have the possibility to load credentialls from a web server?
Hi @PhracturedBlue,
What is the size limit for receiving message ?
I was looking at Memory management . As per their document max receive size is about 1460 bytes per call.
How it's handled here?
Regards,
John
Hello @PhracturedBlue,
I really liked the concept of your project and i have something similar here too. I´m using the Arduino IDE and when compile some reference errors occur (attach..). Should use PlatformIO in this case?
Archiving built core (caching) in: C:\Users\Hero\AppData\Local\Temp\arduino_cache_530916\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_ff614313593e10d027a6bffb631e5a69.a
Linking everything together...
"C:\Users\Hero\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -g -w -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-LC:\Users\Hero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lib" "-LC:\Users\Hero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/ld" "-Teagle.flash.4m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -o "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130/sketch_jul26a.ino.elf" -Wl,--start-group "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\sketch\sketch_jul26a.ino.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266MQTTMesh\Base64.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266MQTTMesh\ESP8266MQTTMesh.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFi.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFiAP.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFiMulti.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFiSTA.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\ESP8266WiFiScan.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\WiFiClient.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\WiFiClientSecure.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\WiFiServer.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESP8266WiFi\WiFiUdp.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESPAsyncTCP\tcp_axtls.c.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESPAsyncTCP\AsyncPrinter.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESPAsyncTCP\ESPAsyncTCP.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESPAsyncTCP\ESPAsyncTCPbuffer.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\ESPAsyncTCP\SyncClient.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\Ticker\Ticker.cpp.o" "C:\Users\Hero\AppData\Local\Temp\arduino_build_4130/arduino.ar" -lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 -llwip_gcc -lstdc++ -Wl,--end-group "-LC:\Users\Hero\AppData\Local\Temp\arduino_build_4130"
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x54): undefined reference to `AsyncMqttClientInternals::ConnAckPacket::ConnAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (bool, unsigned char)>)'C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x58): undefined reference to `AsyncMqttClientInternals::PingRespPacket::PingRespPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void ()>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x5c): undefined reference to `AsyncMqttClientInternals::SubAckPacket::SubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short, char)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x60): undefined reference to `AsyncMqttClientInternals::UnsubAckPacket::UnsubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x64): undefined reference to `AsyncMqttClientInternals::PublishPacket::PublishPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (char*, char*, unsigned char, bool, bool, unsigned int, unsigned int, unsigned int, unsigned short)>, std::function<void (unsigned short, unsigned char)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x68): undefined reference to `AsyncMqttClientInternals::PubRelPacket::PubRelPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x6c): undefined reference to `AsyncMqttClientInternals::PubAckPacket::PubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x70): undefined reference to `AsyncMqttClientInternals::PubRecPacket::PubRecPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o:(.text._ZN15AsyncMqttClient7_onDataEP11AsyncClientPcj+0x74): undefined reference to `AsyncMqttClientInternals::PubCompPacket::PubCompPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `AsyncMqttClient::_onData(AsyncClient*, char*, unsigned int)':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::ConnAckPacket::ConnAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (bool, unsigned char)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (AsyncMqttClient::)(bool, unsigned char)> (AsyncMqttClient, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_init_functor(std::_Any_data&, std::_Bind<std::_Mem_fn<void (AsyncMqttClient::)(bool, unsigned char)> (AsyncMqttClient, std::_Placeholder<1>, std::_Placeholder<2>)>&&, std::integral_constant<bool, false>)':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PingRespPacket::PingRespPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void ()>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (AsyncMqttClient::)()> (AsyncMqttClient)> >::_M_init_functor(std::_Any_data&, std::_Bind<std::_Mem_fn<void (AsyncMqttClient::)()> (AsyncMqttClient)>&&, std::integral_constant<bool, false>)':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::SubAckPacket::SubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short, char)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `AsyncMqttClient::_onData(AsyncClient*, char*, unsigned int)':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::UnsubAckPacket::UnsubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PublishPacket::PublishPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (char*, char*, unsigned char, bool, bool, unsigned int, unsigned int, unsigned int, unsigned short)>, std::function<void (unsigned short, unsigned char)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `function<std::_Bind<std::_Mem_fn<void (AsyncMqttClient::)(char, char*, unsigned char, bool, bool, unsigned int, unsigned int, unsigned int, short unsigned int)>(AsyncMqttClient*, std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, std::_Placeholder<4>, std::_Placeholder<5>, std::_Placeholder<6>, std::_Placeholder<7>, std::_Placeholder<8>, std::_Placeholder<9>)>, void>':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PubRelPacket::PubRelPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `AsyncMqttClient::_onData(AsyncClient*, char*, unsigned int)':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PubAckPacket::PubAckPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `_Bind<AsyncMqttClient* const, const std::_Placeholder<1>&>':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PubRecPacket::PubRecPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
C:\Users\Hero\AppData\Local\Temp\arduino_build_4130\libraries\AsyncMqttClient\AsyncMqttClient.cpp.o: In function `_Head_base<AsyncMqttClient* const, void>':
C:\Users\Hero\Documents\Arduino\libraries\AsyncMqttClient/AsyncMqttClient.cpp:92: undefined reference to `AsyncMqttClientInternals::PubCompPacket::PubCompPacket(AsyncMqttClientInternals::ParsingInformation*, std::function<void (unsigned short)>)'
collect2.exe: error: ld returned 1 exit status
What is the maximum number of nodes that can connect to the network?
Hi, I am trying to update a single node with
python3 send_ota.py --bin newfirmware.bin --node 30592d --id 0x1337
File: newfirmware.bin
Sending to topic: esp8266-in/ota/0x1337/
Listening to topic: esp8266-out
Connected with result code 0
Erasing...
Updating firmware on the following nodes:
30592d
Got unexpected md5 for node 30592d at 0x0
b'19a95c7c365a9b964ca6f9ccf065431b' (expected: b'fb5322bdc18b2f95b9ffb5f099f65672')
[onMqttMessage] Message arrived [esp8266-in/ota/0x1337/start] 'md5:Qri8j86Bnie4cH5KMEUotA==,len:250224'
[handle_ota] OTA cmd 0x1337/start Length: 39
[handle_ota] OTA Start
[parse_ota_info] Key/Value: md5:Qri8j86Bnie4cH5KMEUotA==
[parse_ota_info] Key: md5 Value: Qri8j86Bnie4cH5KMEUotA==
[parse_ota_info] Key/Value: len:250224
[parse_ota_info] Key: len Value: 250224
[handle_ota] -> md5:Qri8j86Bnie4cH5KMEUotA==,len:250224
[handle_ota] Erasing 62 sectors
LmacRxBlk:0
[erase_sector] Erase complete in 2.155131 seconds
[publish] Sending: esp8266-out/30592d/ota/erase=2155131
LmacRxBlk:0
[onMqttMessage] Message arrived [esp8266-in/ota/0x1337/0] '6QECQJzyEEAA8BBAaAUAABAQAABQ9RBAHEsAQMwkAED///8///8PQP9/EED///9f8P//PwAQAAAc4gBAAEoAQExKAEAABwBgAAAAgOgrAEDwMABAoC8AQLcdwQQAEgBgABAA63wSAGASwdAJsfmh/QEpTzhPIeb/KiNLPwxEAeb/wAAAjFIMEoYHAAAAIeH/KQ8oDygCKS8oDygSKT84H4svAd7/wAAADAIdDwix+KESwTAN8AAAABLBwAnx+eH9ASmPKI8i0hApDzLPECgPQqAIAdH/wAAAjEIMEkYuAAAoD4siKQ8MAikfBiUADAIpbwwCKX8yzxgoDwyEAcf/wAAAjDIMIsYjACgPiyIpDyhvKT8MAiJPCCg/McH/JzMEDBIiTwgoPzG//yezDCg/Mb7/JzMEDBIiTwgoPzG8/yezBSKgASJPCDIPCAwSICMwICB0jJIofzgPKiMpD8YGADg/SH8oDwGs/8AAAIxCDDJGCQAAKH84DyojKQ8o'
[handle_ota] OTA cmd 0x1337/0 Length: 508
[handle_ota] Got 381 bytes FW @ 0
[handle_ota] Wrote 381 bytes in 0.004067 seconds
[publish] Sending: esp8266-out/30592d/ota/md5/0=19a95c7c365a9b964ca6f9ccf065431b
[onMqttMessage] Message arrived [esp8266-in/ota/0x1337/0] 'HxsiKR8iDxE4HyezAsbX/xGo/yhfPQKgAwAMAh0PCPH44RLBQA3wEsGwAmETwmES0mER4mEQ+fH9ASmPOZ9Jry0B7QIojyAgBMxiKJ8gIAQWQgAMEoYvACGX/yk/KD8LIilPKD+NAgwJgC0l0NkR0NIg0MgRKD9tAgwHYC0l0LcRsLIg0KYRKD/7IiAkQcAiESARwC0BLQIpXzivKD8qIwsyKD8gIGAgIxApDyiPKR8onykvBhYAKC84PwGA/8AAAAF//8AAAIxCDCIGEgAAOF8oH0g/AXH/wAAAjEIMMgYNAAA4XygvSD8Bdv/AAACMQgxCBggAADgfKD8qIykfOC8oPyojKS84Dyg/ICPAKQ8oD1YS+gwCHQ4dDwIhE8IhEtIhEeIhEPjxEsFQDfAAkqCgkBHAAmEn8mEmEPEgIqAJKQ8ioABF2v9LL8UZAMzShSYATAIBXv/AAACGBAAAfPIpLwwCIm8DIqB+AVn/wAAAKC9mElIioGMBVf/AAAAioHAB'
[handle_ota] OTA cmd 0x1337/0 Length: 516
[handle_ota] Got 387 bytes FW @ 0
[handle_ota] Wrote 387 bytes in 0.003987 seconds
[publish] Sending: esp8266-out/30592d/ota/md5/0=1d57808925ccb704f6294bc74c1cc75e
Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.
I am using platformio which handles the versions
If you are you using platformio or Arduino, which one?
Home 0.3.2·Core 3.5.0b3
Description of problem:
I have tried to instantiate the ESP8266MQTTMesh class inside the setup in the hello world and this does not working by any means. I am trying to do this because I get the MQTTserverIP from the SPIFFS in the setup and can not do it outside.
Arduino 1.8.5
I dont know where my node connect because they can move and signal maybe variabile. I dont know if Node connect to mesh or direct to Wifi. I know, that first run of node must be directly connected to Wifi. Number X in mesh_8266-X change how ? One uniqe ID have one mesh_8266-X ? or can be more nodes with mesh_8266-X ?
mesh_8266-1/123456
mesh_8266-1/987654
mesh_8266-1/123789
or
mesh_8266-1/123456
mesh_8266-2/987654
mesh_8266-3/123789
i say, that i know wich ESP ID is where physically and i dont know where they connected and i acctualy write web application that assign to bunch of nodes "virtual numbers" to something called "Zone1/2/3". Because i map UniqeID to virtualnumbers which are assigned to zone. For me would be best publish to esp8266-in/+/UNIQE-ID , because i can read it esp8266-out/+/UniqeID
Hi @PhracturedBlue ,
I am trying to upload pre-configured settings by following doc https://github.com/PhracturedBlue/ESP8266MQTTMesh/blob/master/docs/Filesystem.md
As ":" is special character for windows file system and it won't allow me to create file with special character.
Is it still possible to upload such configuration from windows ?
John
I tested the mesh feature and it works great. I was wondering how is the logic behind the mesh. When a node losses connection from broker and some time goes through it looks for known bssids and then publishes a message? That would not make sense because nodes can not become brokers. I dont get what protocol the code does to send messages between nodes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.