Chat freely about anything...

User avatar
By sfranzyshen
#56481
rudy wrote:I am currently running your code. Just got it up and running with my LCD additions and name node name translation.


curious what code you have for name node name translation ... can you share?
User avatar
By rudy
#56489
sfranzyshen wrote:
rudy wrote:I am currently running your code. Just got it up and running with my LCD additions and name node name translation.

curious what code you have for name node name translation ... can you share?


Oh, it's really sophisticated. :ugeek:

With the ChipID (now NodeID) the number is very big and when the messages are being updated it is hard to identify what is happening since the 'Received from' could be different that the 'Hello from node'. Five serial monitors, with four being updated (hopefully) with each broadcast send, is hard to keep track of when the device ID number is six or more digits long. So before I display the result I do a translation of the ChipID/NodeID to something I can relate to the ESP modules in my system.

I use a number to identify each one but I could just as easily called one George and another one Shirly. I have each module labeled with the last three digits of the IP address assigned to it. When I have a server running on one I look at the number I have it labeled as, 103 for example, and I have a favorite/bookmark listed as 103, and when I open it the IP address used is 192.168.100.103 I know that 106 is the module on the right side of my desk, 104 is to the left of my monitor, 103 is to the left of that, ...

I have a 20x4 character LCD on each of the modules connected via I2C. Because of the 20 character line limit I shortened the message text to fit on the lines. This is what I display on each.

I am 107 11 5 Unit number, WiFi channel, units connected
Got from 103 Who 107 received the message from. Shorter than 'Hello from node' .
Hi from 104 Who was the original sender. Hi from being shorter than 'Received from'.
7E572C36 The NodeTime

So now that you know what I mean you most likely know that it isn't sophisticated code. I'm not good at sophisticated code. Brute force, and simple, is more my ability.

Code: Select allvoid txtFrom(uint32_t var) {
 
switch (var) {
    case 888274678:
      whoIs="104";
      break;
    case 2131077732:
      whoIs="102";
      break;
    case 886613302:
      whoIs="103";
      break;
    case 888453468:
      whoIs="107";
      break;
    case 2131077688:
      whoIs="106";
      break;     
    case 883356933:
      whoIs="110";
      break;       
    default:
      whoIs=var;
    break;
  }
 


Called at the beginning of the sketch. Also when printing "from". If the NodeID is not in the list, no match, then the default loads the NodeID number to be printed. Very simple and crude. And I will still understand it when I look at the code six months from now. (I'm not a programmer)

Code: Select all  myNodeID=(mesh.getNodeId());
  txtFrom(myNodeID);
  lcd.setCursor(0, 0);
  lcd.print("I am ");   
  lcd.print(whoIs);

 Serial.println("");                  // print real node ID
 Serial.print("my NodeID is "); 
 Serial.print(mesh.getNodeId());   
 Serial.print("   ");   
 Serial.println(mesh.getNodeId(),HEX);   


Code: Select all    lcd.setCursor(0, 1);   
    lcd.print("Got from ");   

    txtFrom(from);         // find out who from is. fills whoIs string
    lcd.print(whoIs);


Last night I used the code in your Github easymeshDevelop. As it is assigning one SSID I assume this is different than what you had submitted to Coopdis/easyMesh. I don't know if what I have has the bug you mentioned. I have not had time to reload the library. I will do it tomorrow or if I can't then on Saturday. What I have seems to be working for me so far. Other than the rollover problem originally there.

What I have seems to work. I added a serial routine so that I can send messages along with the original demo procedure. What I hope to do is add a server to this code and see if I can have it run alongside this code.
User avatar
By sfranzyshen
#56523 One of the things I am trying to do is when a node is powered off that has a "wifi connected client device" (like an android cell phone) ... the "wifi connected client device" (the phone) would detect the lost wifi AP connection and automatically attempt to reconnect to the same wifi (ssid) network ... by connecting to one of the other nodes (AP).

this is know as wifi roaming ... all APs are set to the same SSID and should have different channels (1,6,13) ... and here is where our problem lies ... the esp8266 AP wifi channel and STA wifi channel are always set to be the same (the AP will always adjust it's channel to match what the STA is set/changed to) this is because the esp8266 has only one radio and can only operate on one channel at any time ...

I tested multiple android devices ... it turns out that they suck in general at roaming ... but even with an app that fixes the roaming issue ... android devices do not detect that a wifi connection was lost when two APs have the same ssid and also have the same channel set ... If the two APs have the same ssid yet are on different channels the android device (using a special app) will detect the loss and sign on to the next AP ...

I have not tested this on apple or windows phones ... I understand they are both superior to android ...