Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
Tim__ 112
Has anyone successfully received a UDP message on an HC2? There has been some previous discussion on here, but I could not locate any success.
I have this code running in a Virtual Device's main loop:
Please login or register to see this code.
I then send some test messages using ncat.exe from my PC (which is at 192.168.30.26) to HC2 (at 192.168.60.220)
C:\ncat -u 192.168.60.220 40002
Once I press enter to send the message, I get a response from ncat "Ncat: An existing connection was forcibly closed by the remote host.", and the HC2 code fibaro:debug('Buffer: '..buffer); returns nothing in the debug screen. Is my UDP receive code incorrect, or does HC2 just not support UDP?
I plan to send a message from an Arduino I control (so I can select the message and selected port etc), and when the HC2 receives it, I will store the message in a global variable. The message is a simple "1", indicating that the smoke alarm has been activated. I chose UDP because I thought it was a simple interface. If UDP doesn't work, is there is another way to achieve this without setting up a middle man (like MQTT)?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.