Hi
Anyone help with a Homeyduino issue? I’m sure I’m missing something simple but just cannot see the issue. I’m building a small power fail sensor project and hardware side is working fine. The unit connects to nextwork correctly and I can see it has an IP address etc. but the Homey Pro simply doesnt see any devices.
I’ve stripped the code right back to bare minimum as a test - see below but when looking for a device in Homey Pro it sees nothing. The App seems to have installed fine, just doesnt find anything.
Any advice appreciated as I can’t see what I missed.
The code
/*****
#include <WiFiNINA.h>
#include <Homey.h>
bool state = false;
bool previousButtonState = false;
unsigned long previousMillis = 0;
const unsigned long interval = 100; //Interval in milliseconds
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial);
// attempt to connect to Wifi network:
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to network: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(10000);
}
Homey.begin("Power Sensor");
Homey.setClass("sensor");
// you're connected now, so print out the data:
Serial.println("You're connected to the network");
Serial.println("----------------------------------------");
printData();
Serial.println("----------------------------------------");
}
void loop() {
Homey.loop();
}
void printData() {
Serial.println("Board Information:");
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
Serial.println();
Serial.println("Network Information:");
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.println(rssi);
byte encryption = WiFi.encryptionType();
Serial.print("Encryption Type:");
Serial.println(encryption, HEX);
Serial.println();
}
*****/
tcpdump your local network (the one that has both Homey and your Homeyduino device) to see if you can see UDP broadcasts to port 46639, which is used for discovery. If you can’t see any, the issue is with your Homeyduino device. If you can see them, the issue is with Homey.
According to the documentation, you should also be able to configure Homeyduino manually using the IP address of your device, have you tried that?
Thanks Robert, I’m not back home until weekend but will try that, I wasnt sure what port Homey looked on so thats useful info. I do know the MKR1010 board is working okay with Arduinio’s own Smart Home solution and installs with no issues so I suspect for some reason Homey is not seeing it but just logged in and checked, I’ve got nothing blocked on the LAN so should be ok. I’ll check at weekend and let you know.
Cheers
Hi Robert
Finally back home and tried tcpdump for that port (and a pktmon) but can’t see any traffic which seems odd. I think I had the correct command ( tcpdump -i any -n udp port 46639) but tried several varients and none show traffic. I double checked IP’s and both Homey Pro and the Arduino are on same sub net so its not that. Whats odd is the Homeyduino App asks for a manual option after failing but even entering the IP manually still doesnt find anything - very confused as to what I’m missing now, any other thoughts on what I could try?
Cheers
Instead of tcpdumping on the port, since you know the Arduino’s IP address you can also tcpdump on its IP:
tcpdump -n src AA.BB.CC.DD
(AA.BB.CC.DD
being the IP address)
But I would expect data to show up for the port as well, so this is just to make sure that apparently, something’s not right with your Arduino device. I’m not sure if HomeyDuino has (debug) logging enabled, but that would also be useful to check out, perhaps it’s throwing some error that’s preventing it from broadcasting itself.
But maybe it’s easier to drop HomeyDuino altogether (since it’s not really being maintained anyway) and look as something like ESPHome or Tasmota (although I’m not sure if those support your device).
Thanks Robert, its very weird, I think I must be missing something obvious as no packets captured but definitely on my network, I can track it under my network managemnt tools and if I use the Arduino Cloud Samrt stuff it connects fine and registers so board is not faulty. I may take a look at the other stuff you suggested as didnt realise Homeyduino is not being supported any more.
All this to create a power fail sensor as I can;t find a ready made decent one!!!
Thanks again.
I might expore picking up from my UPS, I’d originally avoided this and didnt want to set up a seperate NUTS server and it doesnt support any direct IFTTT links etc.
Back to drawing board