Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    UDP Broadcast address problem

    Flic Hub SDK
    2
    3
    1366
    Loading More Posts
    • 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.
    • xAPPO
      xAPPO last edited by xAPPO

      If I use an address of say 192.168.1.255 with udp.send to broadcast a message to my subnet, or anything ending in 255, I am getting the following

      Error: EACCES (permission denied)
      

      Specific non broadcast IP address do work.. and RX is working OK from broadcast. What am I doing wrong ?

      1 Reply Last reply Reply Quote 0
      • xAPPO
        xAPPO last edited by

        Thanks and apologies Emil - you have no idea how many times I read the API details - and missed that aspect. Working now.

        Great job with this API - just another vote for MQTT client support in the future

        1 Reply Last reply Reply Quote 0
        • Emil
          Emil FlicTeam last edited by

          What you should do is to first call bind, followed by setBroadcast(true) on the socket. Then you can send messages using send.
          FYI, the API is made to be compatible with Node.js API https://nodejs.org/api/dgram.html.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post