ok so, i am trying this simple code to connect my arduino mega+ CC3000 to my wifi hotspot and connect it to blynk. no matter what i do i cannot get it to work. i open hotspot, it connects to hotspot, the buildtest example is running fine, no errors, it gets the IP all fine. it will just not connect to blynk.
any solutions?
EDIT: it prints “invalid auth token”, i have copied and pasted it.
EDIT2: after a seiries of bad luck, some bad memory and a burned power supply i got a new arduino mega. now Blynk.begin() does not even start.
When you copy and paste the token in, are you leaving the " quotation marks there? I think you need them. Maybe someone else can confirm. Something to try anyway.
This might be a stupid question, but did you generated an auth token on the app and is the app connecting to Blynk correctly with your user credentials?
The only thing I can imagine, but also not very likely, is that your wifi shield or arduino is defective, but since you can upload sketches fine, I’d suspect the wifi shield.
Did you run other network examples from the adafruit library and do those work with network connectivity?
for some reason it fixed itself(?) i rest my case maybe my shield is weird afterall, if it acts strangely again i’ll definitely know i suppose… maybe it was the phone’s (server) fault too, i tinkered a bit connecting my phone to my computer and vice versa to see what happened, after that when i retried cc3000 to phone it just worked for some reason.
edit: WAS… i will never know what is going on… now it says “invalid token” again
edit2: ok i DO know what is going on. it has nothing to do with hardware on network.
apparently i forgot somewhere a pinMode() that for some reason disrupts the process even though i use pins 30 to 45ish and shouldn’t(?)
I think I heard other people about that too. There are a couple pins reserved for stuff, but as you mentioned, 30 - 45 shouldn’t be in that range I think. You could try others, but I suppose that wouldn’t matter.
First thing I like to do is exclude hardware problems and wiring issues, but with a shield that should be ok. PinMode shouldn’t be really needed, but it is the correct way to do things and I like to be correct when it comes to coding
Hmm, ok. I’ve written quite some lines for my Mega overhere: Home Domotics and I do pinMode after blynk.begin(), but then again, I’m using the ethernet shield so it may be something in the library for the shield.
it seems like a memory problem, i declared a char[]=“hello there!” around that and it prints as a “hAllo there!” or “h@llo there!” or cc3000 is faulty and sends wrong data from time to time.
Edit: it seems my UNO has some bad memory, #themoreyouknow, still doesn’t explain why i got the invalid token on mega before? maybe i had just bad luck?