Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send data to nodes. #2

Closed
ghost opened this issue Sep 4, 2015 · 9 comments
Closed

Send data to nodes. #2

ghost opened this issue Sep 4, 2015 · 9 comments

Comments

@ghost
Copy link

ghost commented Sep 4, 2015

Hi,

Id reached a awesome transmitting rage of 20Km with your code and 4 ESps (I live on a Island, there is no much RF traffic).

The Addressing works like a charm, every node has a unique address.
But how can i send data to nodes ?

For example i would like to send data from node 1 through 2-3 to 4.
In my case weather data.

Will the address of each unique node be saved? (If id understood the code correct yes or ?)
Can a Node get information about all the other nodes in the complete mesh network?

Thanks in advance.

@brannondorsey
Copy link
Member

Hey there @gamecompiler!

This code is pretty experimental. One thing that I was relying on was that an ESP in AP mode would have capabilities to route messages to nodes connected to them (like a normal AP).

Given:

192.168.4.1 (AP)
192.168.4.2 (AP_STA) -> 192.168.4.1 (AP)
192.168.4.3 (AP_STA) -> 192.168.4.1 (AP)

One would think that 192.168.4.2 could exchange data with 192.168.4.3 because they are on the same "network" being served by the 192.168.4.1. I have since learned that this is not possible (see this post). Basically, what that means is that this meshish library (as it is written now) will never actually be that mesh like. What it is good for is auto configuring two ESP8266 to talk to each other (or even 3, 4, 5+, however the communication will always be secondary nodes to primary nodes and vice versa, never secondary node to secondary node through the primary node). If you need to connect 4 ESPs over a great distance (say, in a line one after another) it might be easier to manually assign each an SSID and have them in STA_AP mode, each serving a network while simultaneously acting as a station to the next one's network. Would that work for your purposes? If not tell me a bit more about the purpose and limitations of your project? I am interested to think of a better way to write a mesh-like library for the ESPs. Have you seen the Arduino WiFiMesh library? Personally I really don't like it.

@ghost
Copy link
Author

ghost commented Oct 16, 2015

My goal is to "Mesh up" temperature sensor throwies so that they can reach my home wirelessly.
I live on a small Island, the problem is that in automn, the meadows are flodden. So i cant go to them and get the loggs or even do any maintance. So id thought it would be awesome to mesh up the sensors to a 20Km line of water distance.

Thanks for the Idea, id connected 5 esps now over STA_AP mode, if one gets a udp package, they become redirected to each other of the line, until every one has received the package.

But at this time all my esps are crashing after quick time, because sometimes the message identfycation checksum is transmitten wrong, which happens a lot.... The Buffer becomes flodden and the esps do a hard reset....

Yes id tryed the WiFiMesh library, i cant get it work, i really dont know why....

We should try to make a "real" mesh library,
im doing some research at this time, there needs sth to be done.....(Im wondering that almost no one asked for a real esp mesh library)

Sorry for my english.

@brannondorsey
Copy link
Member

Hey there,

Sorry for the late reply. I've had my focus elsewhere recently and have been doing a poor job keeping up with ESP related stuff. Glad to hear that you were able to get a solution working connecting 5 ESPs in STA_AP mode and forward the UDP packets. Any chance that your crashes have anything to do with the watchdog timer? If so, you can extend the watchdog timer time so that the ESPs won't hard reset during some long running custom code. But, if it really is a buffer overflow, that really blows and I'm not sure the best way to help you.

I agree that there needs to be a dedicated mesh solution for the ESPs. It seems like recently ESPRESSIF has actually built this into their firmware. Here is an "official" example of the ESPs acting in true mesh: https://github.com/espressif/ESP8266_LIGHT_WITH_MESH/wiki

The code seems to be used directly with their custom server app which sucks, but maybe there is something there to be played with.

Another approach, and one that a friend of mine (@bakercp) has been working on implementing is to use custom probe requests (a management frame in the 802.11 wireless spec) to advertise information from one node to many (in a broadcast type fashion) without those nodes actually having to be associated with one another in a AP/STA relationship. I know that the ability to broadcast custom probe requests is now possible in the new 1.4 Espressif SDK. Here is an example of a project that uses this style of packet injection: https://github.com/pulkin/esp8266-injection-example

Unfortunately right now this ESP mesh library isn't a priority for me, but if you happen to keep working on it or reach a major breakthrough, keep me in the loop and maybe I can provide some development.

Cheers!

And P.S. your English is awesome :)

@hrj
Copy link

hrj commented Jul 21, 2016

If the amount of data to be sent is small (less than 100 bytes), one could definitely broadcast the management / probe packet. The packet can be captured by putting the ESP8266 into promiscuous mode.

The SDK also has the ability to send arbitrary data packets, but unfortunately, the data packets can't be captured in their entirety. Only their length can be observed! 😞

@ghost
Copy link
Author

ghost commented Jan 20, 2018

3 years later i know what problem id had ;) Yes, it was a problem with the watchdog timer. Id made an endless loop... . Last years i learned a lot about programming. Thank you very much for your support! It was fun connecting my complete island!

@ghost ghost closed this as completed Jan 20, 2018
@brannondorsey
Copy link
Member

Hi there @gamecompiler, great to hear from you! Glad to hear you had success as well 😸.

I'd love to hear about your network! Did you end up using any of this code, or did you roll something yourself? How wide reaching is your network? I'd love to hear more.

@ghost
Copy link
Author

ghost commented Jan 24, 2018

Im sending you an email :)

@sriksh9
Copy link

sriksh9 commented Jan 25, 2018

Hi @gamecompiler, I am trying the HelloMesh example in Arduino IDE. I see that the communication happens, It seems like a data broadcast. I wanted to send data to a particular node, could you please help me guiding through this?

@ghost
Copy link
Author

ghost commented Jan 26, 2018

Currently i cant because ive have to learn for a lot of exams. Keep in mind that meshish isnt in the state that it can be used. You still need to route the data your self. Meshish is more a concept - not a solution.

You will have to implement your own routing algorithm.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants