Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I'm too suspicious maybe

I'm too suspicious maybe

Scheduled Pinned Locked Moved The Lounge
graphicsadobesysadminhelpquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    I figured out a simple way to (I think?) expand the number of nodes on an ESP-NOW mesh network past the supposed maximum of 20 by simply not keeping peers around. Instead, I add a peer, send a message, remove the peer. You can still receive messages from peers when they aren't added, and even if you couldn't you get acks and you could delete the peer on the ack and just poll using a request/response cycle like HTTP. It's too simple of a hack for too much of a win. Simple enough that it makes me wonder why they designed it the way they did (to keep a peer list) instead of just doing it like the above and essentially keeping no list, with everything stateless. You don't need the peer list, you just need a list of mac addresses and you can keep that in a std::map or even a std::vector if you need it (you can avoid that even because the nodes can broadcast their macs and you can pick them out of the air) I don't know if I'm looking a gift horse in the mouth, or if I have the appropriate amount of skepticism about my approach. I wonder if it's a general issue when I code. Maybe I should just take my wins as I find them.

    To err is human. Fortune favors the monsters.

    D Kornfeld Eliyahu PeterK L R 4 Replies Last reply
    0
    • H honey the codewitch

      I figured out a simple way to (I think?) expand the number of nodes on an ESP-NOW mesh network past the supposed maximum of 20 by simply not keeping peers around. Instead, I add a peer, send a message, remove the peer. You can still receive messages from peers when they aren't added, and even if you couldn't you get acks and you could delete the peer on the ack and just poll using a request/response cycle like HTTP. It's too simple of a hack for too much of a win. Simple enough that it makes me wonder why they designed it the way they did (to keep a peer list) instead of just doing it like the above and essentially keeping no list, with everything stateless. You don't need the peer list, you just need a list of mac addresses and you can keep that in a std::map or even a std::vector if you need it (you can avoid that even because the nodes can broadcast their macs and you can pick them out of the air) I don't know if I'm looking a gift horse in the mouth, or if I have the appropriate amount of skepticism about my approach. I wonder if it's a general issue when I code. Maybe I should just take my wins as I find them.

      To err is human. Fortune favors the monsters.

      D Offline
      D Offline
      Daniel Pfeffer
      wrote on last edited by
      #2

      Hmm. Issues with race conditions, perhaps? Note that the list of active MAC addresses is a state.

      Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

      H 1 Reply Last reply
      0
      • D Daniel Pfeffer

        Hmm. Issues with race conditions, perhaps? Note that the list of active MAC addresses is a state.

        Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #3

        Indeed the list of mac addresses is, but you don't really need that as you can snatch macs out of the air, at the expense of some time and battery. It's more just an optimization. :)

        To err is human. Fortune favors the monsters.

        1 Reply Last reply
        0
        • H honey the codewitch

          I figured out a simple way to (I think?) expand the number of nodes on an ESP-NOW mesh network past the supposed maximum of 20 by simply not keeping peers around. Instead, I add a peer, send a message, remove the peer. You can still receive messages from peers when they aren't added, and even if you couldn't you get acks and you could delete the peer on the ack and just poll using a request/response cycle like HTTP. It's too simple of a hack for too much of a win. Simple enough that it makes me wonder why they designed it the way they did (to keep a peer list) instead of just doing it like the above and essentially keeping no list, with everything stateless. You don't need the peer list, you just need a list of mac addresses and you can keep that in a std::map or even a std::vector if you need it (you can avoid that even because the nodes can broadcast their macs and you can pick them out of the air) I don't know if I'm looking a gift horse in the mouth, or if I have the appropriate amount of skepticism about my approach. I wonder if it's a general issue when I code. Maybe I should just take my wins as I find them.

          To err is human. Fortune favors the monsters.

          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu Peter
          wrote on last edited by
          #4

          You should not be that paranoid - trust yourself... If it works for you - under fair test load of course - then do not disturb yourself why other done it differently... Possible reasons to choose to manage a peer-list is performance around the management or maybe a race-condition over resources (the time it takes to acquire/release them)

          "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid." ― Albert Einstein

          "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

          1 Reply Last reply
          0
          • H honey the codewitch

            I figured out a simple way to (I think?) expand the number of nodes on an ESP-NOW mesh network past the supposed maximum of 20 by simply not keeping peers around. Instead, I add a peer, send a message, remove the peer. You can still receive messages from peers when they aren't added, and even if you couldn't you get acks and you could delete the peer on the ack and just poll using a request/response cycle like HTTP. It's too simple of a hack for too much of a win. Simple enough that it makes me wonder why they designed it the way they did (to keep a peer list) instead of just doing it like the above and essentially keeping no list, with everything stateless. You don't need the peer list, you just need a list of mac addresses and you can keep that in a std::map or even a std::vector if you need it (you can avoid that even because the nodes can broadcast their macs and you can pick them out of the air) I don't know if I'm looking a gift horse in the mouth, or if I have the appropriate amount of skepticism about my approach. I wonder if it's a general issue when I code. Maybe I should just take my wins as I find them.

            To err is human. Fortune favors the monsters.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Heh,

            honey the codewitch wrote:

            on an ESP-NOW mesh network

            Gives [new meaning](https://www.google.com/search?q=hub-and-spoke+topology) to your [bicycle joke](https://www.codeproject.com/Lounge.aspx?msg=5905474#xx5905474xx) yesterday. :-D

            1 Reply Last reply
            0
            • H honey the codewitch

              I figured out a simple way to (I think?) expand the number of nodes on an ESP-NOW mesh network past the supposed maximum of 20 by simply not keeping peers around. Instead, I add a peer, send a message, remove the peer. You can still receive messages from peers when they aren't added, and even if you couldn't you get acks and you could delete the peer on the ack and just poll using a request/response cycle like HTTP. It's too simple of a hack for too much of a win. Simple enough that it makes me wonder why they designed it the way they did (to keep a peer list) instead of just doing it like the above and essentially keeping no list, with everything stateless. You don't need the peer list, you just need a list of mac addresses and you can keep that in a std::map or even a std::vector if you need it (you can avoid that even because the nodes can broadcast their macs and you can pick them out of the air) I don't know if I'm looking a gift horse in the mouth, or if I have the appropriate amount of skepticism about my approach. I wonder if it's a general issue when I code. Maybe I should just take my wins as I find them.

              To err is human. Fortune favors the monsters.

              R Offline
              R Offline
              Ron Anders
              wrote on last edited by
              #6

              Gun shy, PTSD..... get another? cat. :thumbsup:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups