If you followed all the advice of the “How to connect your device to the KSduino Device Network?” article and your Arduino does not online try to check your KSduino and Network parameters:
First of all you should use right Device ID and Device password parameters. Check it first.
Then check the Network parameter: IP address.
Read the next advices if previouse does not helped you:
In the KSduino examples we have used simple setup function. We use only one network parameter for Arduino - its IP. Your local network can use more difficult connection type. The is another variants of setup Arduino network.
Please try next functions to check it:
void begin (byte *mac, unsigned int port)
void begin (byte *mac, byte *ip, byte *dns, byte *gateway,
byte *subnet, unsigned int port)
See description of this functions at KSduino documentation
First one function uses DHCP mode to connect your arduino to your local network. It’s very easy but it takes more bytes in Arduino sketch. Change ksd.begin (…) if you like to use DHCP mode:
ksd.begin (mac, port);
The next one function uses all network parameters, but you should create some new variables to use it:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0D };
byte ip[] = { 192, 168, 0, 222 };
byte dns_address[] = { 192, 168, 0, 1 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
unsigned int port = 58833;
If you know your DNS and Gateway than try to use the long one function. Just change the “192, 168, 0, …” to your values. And replace ksd.begin (…) with this code:
ksd.begin (mac, ip, dns_address, gateway, subnet, port);
Then change the
unsigned int port = 58833;
to
unsigned int port = 40000 + deviceID;
it will help to detect your Arduino at the KSduino UDP server by this number.