This morning I thought about having some sort of MAC address conflict on my network between multiple arduino’s so I basically turned off all of them at home as well as most devices (TV, repeaters, most computers and phones etc. so I could be certain that there wasn’t any type of network conflict.
Still no success. If I disable Cayenne.run() the program works fine, if I enable it, it stops randomly.
I have a question though. How can I set the mac address when starting Cayenne while still using DHCP in order to have an IP? From the examples I found it’s either
Cayenne.begin(token, ipAddress, ipDNS, ipGateway, subnet_mask, mac);
Cayenne.begin(token, , , , , mac);
but it gave me an error.
So, I used a small code that the first time it runs, it generates a random mac and stores it on EEPROM, from that on, if the mac is on EEPROM, it uses it.
I then tried to use the following:
and it does not give me any error, but when I enable “#define CAYENNE_PRINT Serial” it prints a completely different MAC. This is why I decided to check the MAC id’s.
How can I do it properly?
( I am still fighting to figure out what is wrong with Cayenne… please see if you find a bug or something wrong with my code).