by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
ilopata1
@ilopata1
@BlackEdder_gitlab I have not tried that yet; on my list. I agree that 160m is pretty good, particularly as I am in a residential area with many competing signals, but I want to make sure that I am getting the most out of the platform. Is there a reason why the function prototype detailed in the Read Me was removed?
BlackEdder
@BlackEdder_gitlab
It was removed, because (at that point) only ESP8266 supported it. Does ESP32 also suport it?
ilopata1
@ilopata1
Yes, according to the latest ESP-IDF programming guide for the WiFi Driver
Craigzyc
@Craigzyc
@ilopata1 I'm using LR in my project. I seem to get the same range as using another long range master/slave example I found. It also has the benefit of hiding the SSID from basically every device in existance except the ESP32 in LR mode without slowing discovery with an actual hidden SSID.
@BlackEdder_gitlab I appologize if this has been answered. Why is the mesh structure updated every 3 seconds rather than on change? It seems like if each node were to broadcast when it has a change it would accomplish the same thing without slowing the network? Is the 3 seconds tunable at all, and if so where? I plan a rather large mesh so just looking for optimizations.
ilopata1
@ilopata1
@Craigzyc Thanks. Did you implement with the same call and at the same point as I listed above?
BlackEdder
@BlackEdder_gitlab
@Craigzyc Where do you get the 3 seconds from?
Craigzyc
@Craigzyc
@BlackEdder_gitlab https://gitlab.com/painlessMesh/painlessMesh/-/wikis/mesh-protocol#routing-information According to this it does it every 3 seconds and it seems like it passes a ton of information, especially on a large network. I was thinking if you instead sent that every minute or so, and instead sent a broadcast when a connection changed in each nodes list of STA connections, it would still propagate but without the regular usage of bandwidth. I could be misunderstanding what I'm reading.

@ilopata1 Yes, similar. I just put it as the last lines of my setup.
In the Gateway

ESP_ERROR_CHECK( esp_wifi_set_protocol(WIFI_IF_AP, WIFI_PROTOCOL_LR) );

In the Nodes

ESP_ERROR_CHECK( esp_wifi_set_protocol(WIFI_IF_AP, WIFI_PROTOCOL_LR) );
ESP_ERROR_CHECK( esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_LR) );

I'm guessing you did the AP as well although you don't mention it? I'm not sure it would work without that.

I had previously used the code from the below repository to test a single connection
https://github.com/jnogues/ESP32-Long-Range-WiFi
I'll warn you so you don't have my frusteration, I had to clear the NVM after to get it to work with painlessmesh

ilopata1
@ilopata1
@Craigzyc Thanks for the confirmation!
Craigzyc
@Craigzyc
@ilopata1 Just making sure you see the updated comment
I seem to get similar range as from that repository, although I am testing its penetration through walls, not open clear range.
ilopata1
@ilopata1
@Craigzyc Got it. I don't have a gateway but I have the WIFI_IF_STA code in every node
Craigzyc
@Craigzyc
@ilopata1 So your STA connections are trying to use the LR protocol but you AP connections aren't. I didn't think they would see eachother that way but maybe they have a workaround so a LR STA can still see non LR APs. Try adding the line for the AP as I doubt you would get any range increase unless both sides of the connection use the LR protocol.
@ilopata1 After my ethernet gateway arrives today, the STA on the gateway will be able to be part of the mesh and it will also get the LR treatment
ilopata1
@ilopata1
@Craigzyc I will do. I think all of my nodes are both AP and STA but admit I havent looked closely at how that is defined -- I just call mesh.init() with default values. I will take a closer look and make sure I am using the correct test
Craigzyc
@Craigzyc
@ilopata1 Then yes, both STA and AP are active. For each node STA connects to a node upstream in the Mesh Tree, AP creates an AccessPoint for nodes downstream in the mesh tree. Every connection between 2 nodes is an AP on one end and a STA on the other. Both would need to be LR enabled
CraigZych
@CraigZych
Anyone have a best practice for advertising the root?
BlackEdder
@BlackEdder_gitlab

@BlackEdder_gitlab https://gitlab.com/painlessMesh/painlessMesh/-/wikis/mesh-protocol#routing-information According to this it does it every 3 seconds and it seems like it passes a ton of information, especially on a large network. I was thinking if you instead sent that every minute or so, and instead sent a broadcast when a connection changed in each nodes list of STA connections, it would still propagate but without the regular usage of bandwidth. I could be misunderstanding what I'm reading.

Sorry that information is out of date. It actually sends it once per minute (unless a change is detected)

Craigzyc
@Craigzyc
@ilopata1 I did some range tests this morning before work. I have not tested this setup without LR enabled but using an ESP on one end with a 6db omnidirectional antenna(maximum allowed to maintain FCC on the modules I believe) and a 5db taoglas patch antenna(https://www.digikey.com/product-detail/en/taoglas-limited/FXP70.07.0053A/931-1074-ND/2332701) on the other end, I achieved 160m in non perfect conditions which is well beyond my expectations. I still had a fair bit of room to go as I was at -87 or so but that was the furthest I could go in a straight line without hitting water. The one end was in my living room with no perfectly straight line to a window in the middle of my house. I'd guess in a field we would be looking at some very impressive numbers with that setup but this was more than enough for my proof of concept.
Have you done any range testing with LR on both ends?
ilopata1
@ilopata1
@Craigzyc Using the ESP32-WROOM-32D on both ends in a residential area with a lot of possible sources of interference I also achieved 160metres
AishwaryaB25
@AishwaryaB25
Hi All,
I am working with painlessmesh library and i want to get the current date and time in my code to load the SSL certificates into ESP8266. When i am using a NTP client for this functionality, the API mesh.stationManual is not working as the bridge node is not connecting to my mobile hotspot. Please anyone let me know whether there is any dependency between the working of painlessmesh APIs and the forceUpdate of time using NTP client.
Thank you,
Joseph Hayhoe
@joe_hayhoe_twitter
Does painlessmeshboost support reconnecting to a mesh as a client after connectivity loss due to a node power loss. I have a rpi connecting to the ssid of the mesh but as I have noticed each time I lose connectivity to the node I end up getting a new IP after wifi reconnects as it connects to a different node. Then I need to re-launch painlessmesh on the rpi in client mode pointing at the new gateway ip
Joseph Hayhoe
@joe_hayhoe_twitter
My mesh consists of 20 esp8266 nodes which move around during use and at times can get far enough away from the stationary raspberry pi to lose connectivity. The raspberry pi in this setup could be considered the root node as it is the only device sending messages into the mesh.
All messages the pi sends are broadcast messages.
ilopata1
@ilopata1

I have a very simple two node mesh of ESP32s on a desktop which connects quickly but falls apart after a little over a minute with the following messages:

15:49:08.572 -> COMMUNICATION: sendBroadcast(): msg=98857.16
15:49:08.572 -> COMMUNICATION: addMessage(): Package sent to queue end -> 1 , FreeMem: 56600
15:49:08.572 -> Sent message: 98857.16
15:49:08.572 -> GENERAL: sentBufferTask()
15:49:08.572 -> COMMUNICATION: writeNext(): Package sent
15:49:08.572 -> GENERAL: sentBufferTask()
15:49:08.572 -> GENERAL: readBufferTask()
15:49:08.642 -> CONNECTION: Time out reached
15:49:08.642 -> CONNECTION: MeshConnection::close() 2935575245.
15:49:08.642 -> CONNECTION: close(): Closing pcb
15:49:08.642 -> CONNECTION: MeshConnection::close() done. Was station: 1.
15:49:08.642 -> CONNECTION: closingTask(): dropping 2935575245 now= 89967922
15:49:08.642 -> MESH_STATUS: Changed connections in neighbour 2935575245
15:49:08.642 -> MESH_STATUS: Dropped connection 2935575245, station 1
15:49:08.677 -> CONNECTION: eraseClosedConnections():
15:49:08.677 -> CONNECTION: ~MeshConnection():
15:49:08.677 -> CONNECTION: connectToAP(): Already connected, and no unknown nodes found: scan rate set to slow
15:49:08.677 -> CONNECTION: eventSTADisconnectedHandler: SYSTEM_EVENT_STA_DISCONNECTED
15:49:08.677 -> MESH_STATUS: Dropped connection 0, station 1
15:49:08.677 -> CONNECTION: eraseClosedConnections():
15:49:08.677 -> CONNECTION: connectToAP(): No unknown nodes found scan rate set to normal

It looks like a timeout, but I am unclear what that really means. If I am reading the code for MeshConnection::initTasks() seems to indicate this may be related to SYNC messages not being received. In the log preceding the entries above I can see the following SYNC events:

15:47:44.837 -> SYNC: nodeSyncTask(): request with 0
15:47:44.907 -> SYNC: handleNodeSync(): with 0
15:47:58.636 -> SYNC: handleNodeSync(): with 2935575245
15:48:58.635 -> SYNC: nodeSyncTask(): request with 2935575245
15:48:58.774 -> SYNC: handleNodeSync(): with 2935575245

Any help with diagnosis/resolution would be appreciated

Joseph Hayhoe
@joe_hayhoe_twitter
Figured it out, switched to server mode and setup the RPi with an AP that matched the nodes. Now they connect and mesh together.
ilopata1
@ilopata1
I think my issue looks a lot like painlessMesh/painlessMesh#310 which has not been resolved
Jahir Argote
@butuq
Hi, is it possible to modify dynamically the mesh tree? Ideally I would like to create an almost fully connected mesh.
ingdemurtas
@ingdemurtas
From the node that is connected to both Mesh and Wifi, I would like to send a POST request to a remote url. Is this compatible with painlessmesh? I keep getting response code -1
fusionstream
@fusionstream
Are messages received via the callback guaranteed to be non corrupt due to the underlying TCP protocol?
BlackEdder
@BlackEdder_gitlab
@fusionstream Corrupt messages will be discarded before the callback is called
fusionstream
@fusionstream
@BlackEdder_gitlab Understood. Thanks for the reply.
ilopata1
@ilopata1
@BlackEdder_gitlab Any tips on what could be cause the TCP error shown below and how to resolve?
19:36:21.996 -> COMMUNICATION: sendSingle(): dest=2935548241 msg=99604.32
19:36:21.996 -> COMMUNICATION: addMessage(): Package sent to queue end -> 1 , FreeMem: 50964
19:36:21.996 -> GENERAL: sentBufferTask()
19:36:21.996 -> CONNECTION: tcp_err(): MeshConnection Connection reset
19:36:22.031 -> CONNECTION: onDisconnect(): dropping 2935548241 now= 221289146
19:36:22.031 -> CONNECTION: MeshConnection::close() 2935548241.
19:36:22.031 -> CONNECTION: MeshConnection::close() done. Was station: 0.
19:36:22.031 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 17 - AP_STAIPASSIGNED
19:36:22.031 -> CONNECTION: closingTask(): dropping 2935548241 now= 221310289
19:36:22.031 -> MESH_STATUS: Changed connections in neighbour 2935548241
19:36:22.066 -> MESH_STATUS: Dropped connection 2935548241, station 0
19:36:22.066 -> CONNECTION: eraseClosedConnections():
19:36:22.066 -> CONNECTION: ~MeshConnection():
BlackEdder
@BlackEdder_gitlab
I am afraid tcp_err is a very general error, so not really sure what causes those
ilopata1
@ilopata1
Over the past several weeks I have battled to get a minimum stable mesh of 2 ESP32s running on my dekstop. The startHere example was reasonably stable, but my own more complex application would not hold together for more than 3 or 4 minutes. I had tinkered with transmit power, scan intervals, timeout values, root identification and a whole lot more and found myself chasing an ever changing set of issues from missing SYNC reply messages that caused timeouts to tcp errors and more. Finally, I have a solution. I stopped using TaskScheduler for scheduling my user tasks and switched to using FreeRTOS tasks. The change was easy to make and immediately delivered a stable application with no other changes to the application structure or functionality. Obviously it would be nice to develop a minimum working example to demonstrate the problem, but it seems to be so dependent on factors such as start-up sequence, compile options and more that it will not be an easy task. I will try to do it at some point For now, at least based on my experience, I would encourage anyone having difficulty getting a stable mesh on ESP32 to try using FreeRTOS for scheduling instead of TaskScheduler.
BlackEdder
@BlackEdder_gitlab
@ilopata1 Did you make these changes in the painlessmesh code or just in your own?
ilopata1
@ilopata1
@BlackEdder_gitlab @BlackEdder_gitlab Just in my own. Somewhat hard to imagine that if there is a race condition or threads are conflicting when using TaskScheduler on the ESP32 that it wouldn't also occur in the painlessmesh code, but so far I have not seen that. I have an (untested) hypothesis that the issue may only occur if I send messages from within a task, but that is complete speculation at the moment.
BlackEdder
@BlackEdder_gitlab
Do you happen to have good documentation on freertos tasks?
ilopata1
@ilopata1
I used these FreeRTOS API web pages and where necessary looked at the code
I think my initial reference may have been this Instructable
dptakh
@dptakh
Greetings community, I know that it has been said that the message rate of 100 per second is at the edge of stable functioning with a reason of HW and something else, and that is also what I was observing ERROR: addMessage(): Message queue full for 3 nodes when each sends of 30 msgs per second. But is there any specific reason that I can point out as an explanation to that in my thesis? Like mesh_update takes more time or some specific amount of HW(CPU freq, memory) is required?
HillBillyWidgets
@HillBillyWidgets
Hi,
I am trying to get the painless mesh examples working in Arduino. I have installed the latest libraries listed that are required. I also have installed and verified the ESP32 board package is up to date and installed. When I try to compile the start here example I get a ton of errors some of which is listed below. Does anyone have a idea what I am missing here? I am at a loss since I used it a couple years ago and had no issues. Any help would be appreciated.
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:27: error: field 'call' has incomplete type 'tcpip_api_call'
struct tcpip_api_call call;
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: forward declaration of 'struct tcpip_api_call'
struct tcpip_api_call call;
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_output(tcp_pcb)':
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: invalid conversion from 'err_t (
)(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]
tcpip_api_call(_tcp_output_api, (struct tcpip_api_call
)&msg);
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:291:65: error: cannot convert 'tcpip_api_call' to 'tcpip_api_call_data' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data)'
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
struct tcpip_api_call call;
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_write(tcp_pcb
, const char, size_t, uint8_t)':
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: invalid conversion from 'err_t (
)(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]
tcpip_api_call(_tcp_write_api, (struct tcpip_api_call
)&msg);
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:307:64: error: cannot convert 'tcpip_api_call' to 'tcpip_api_call_data' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data)'
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
struct tcpip_api_call call;
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_recved(tcp_pcb
, size_t)':
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]
tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call)&msg);
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:322:65: error: cannot convert 'tcpip_api_call
' to 'tcpip_api_call_data' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data)'
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete
struct tcpip_api_call call;
^
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_connect(tcp_pcb, ip_addr_t, uint16_t, tcp_connected_fn)':
C:\Users\Natalie\Documents\Arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp:338:66: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]
tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call*)&msg);
Darshangad
@Darshangad
Hello people,

Need some help. After creating a mesh network, I wanted to monitor the data remotely, not via serial port. To do this, I created a Telnet server and use PuTTy to view the data instead of serial port. Below is the function for it. and In all the serial print lines, I have replaced 'Serial' text with 'Telnet.Printf'. In order to read data in PuTTy I need the IP address. I guess a couple of Node IDs like 10.197.161.1 and 2.. probably it will continue in this series.

  1. How can I find the ID address of all the nodes participating in the mesh network?
  2. How can I make sure that one ESP32 is always assigned the same IP address? (I have 54 ESP32 in my mesh)

    WiFiServer TelnetServer(23);
    WiFiClient Telnet;

    void handleTelnet(){

    if (TelnetServer.hasClient()) {
    if(!Telnet || !Telnet.connected()) {

        if (Telnet)  Telnet.stop();
         Telnet = TelnetServer.available();

    } else {
    TelnetServer.available().stop();
    }
    }
    }

GeoffreyMills
@GeoffreyMills

I setup a bridge node then added the ESPAsyncWebServer to this. This gets a DHCP addresss assigned. //Async webserver
server.on("/", HTTP_GET, {

String nodeList = printNodeList();

request->send(200, "text/html", nodeList + "<form>Text to Broadcast</br><input type='text' name='BROADCAST'> <input type='node' name='NODE'> </br> <input type='submit' value='Submit'></form>");

if (request->hasArg("NODE")){
  int node = request->arg("NODE");
  String msg = request->arg("BROADCAST");
  mesh.sendSingle( node, msg );

} else if  
  (request->hasArg("BROADCAST")){
  String msg = request->arg("BROADCAST");
  mesh.sendBroadcast(msg);
}

});

Then I added this to display the node list, works quite nicely! server.on("/nodes", HTTP_GET, {
   //String nodeList = printNodeList();
   String nodeList = nodeLayout();
    request->send(200, "text/plain", nodeList );
   });
Darshangad
@Darshangad
does painlessmesh support _TASK_MICRO_RES?