-
Notifications
You must be signed in to change notification settings - Fork 4
Part 4. Hub Connection
If you're having trouble getting the Cactus Micro to connect to the hub here are some things to check:
-
Make sure you are on the same WiFi network. The Pi (or whatever else you're using to run the hub) needs to be connected to WiFi in order for the Cactus Micro to talk to it. You can still connect the Pi via ethernet but it must also be connected to WiFi.
-
Make sure that the IP address you're using is correct (hubIP in the sketch). It must be the IP address that the Pi has from the WiFi network. You can find the Pi's IP address from the command line with
$ hostname -I -
Make sure that the port you're telling the Cactus Micro to connect to is the same port the hub is serving on. The hub should print out Node hub serving on port and then the port number it's configured for. Use that port number (port in the sketch).
-
You can manually try connecting to the hub using AT commands like we did with the WiFi. Follow the Connect to WiFi instructions, and, after Step 9, run
AT+CIPMUX=1. You should get the responseOK. Now try connecting to the hub withAT+CIPSTART="TCP","IP_ADDRESS",PORT, replacing IP_ADDRESS with the hub's IP and PORT with the port number the hub is serving on. If the connection is successful, you will seeOK Linked. If you getERROR, try closing the connection (AT+CIPCLOSE) and trying again.
I mentioned this for WiFi debugging, but there is a fantastic PDF on AT commands with the ESP8266 in particular here. Don't pay attention to anything before page 5.