Ive had a really hard time getting my Photon Redboard connected to:
1-The particle app on Android
2-An error message saying Photon cannot disconnect from WiFi
I finally just logged into particle on my laptop and the photon showed up correctly and the LED went to the correct indicator color for connection with particle and WiFI.
My question is: What does the code need to look like after I import the Blynk Library and what files should I include. Bear in mind my discipline is not at all in coding Iām just trying to get my feet wet and learn some Arduino for fun. I need primitive native code to get the app up and running like what to put into the void setup and then what I need to run in the loop to get the app working correctly after I flash it to the Photon Redboard.
Any help is much appreciated. I cant be the only noob that will benefit from this being answered.
In the Web build IDE just import the Blynk library. The IDE will add the appropriate #include statement . In the examples, you may have to comment out some statements that wonāt be needed because the #include statement takes care of it. If I get a chance later Iāll post a simple example Iāve used when playing around with it. Currently away from my photons.
So Ive imported the library, but Im not sure where the authentication token comes into play. I can email a picture of my browser and show you if necessary.
I go to flash the board and i get an error on every instance of each seperate sketch. I can upload the error message if necessary. Thanks for your help I think Im close just missing a little bit of the code. I havenāt put anything inside the setup or the loop so Im thinking I need some more code to make it work.
> However, Iāll repeat: Blynk only confirmed to work with official Particle Core and Photon, not with the SparkFun Photon Redboard
I guess I thought the Red Board was nothing more than a photon on an Arduino style break out board. Running the same firmware as a photon. @IOTnoob the instructions from @Pavel should be what you need to get going. Hopefully the Red Board is as I suspect and works out of the box with Blynk. Please tinker around with it and let us know. Iāve been playing around with Blynk on the photon off and on for a week now and love it!
Sorry, and Im fairly embarassed and somewhat disheartened at this point. Went and bought a particle issued Photon. Still cant get blynk to flash onto a photon. I have my particle account setup. I create an app, type in blynk it pulls up the blynk library. I click on the sparkcore.ino file and click on āuse this exampleā. I copy and paste the auth token from my email into the [] and hit flash and still get an error message. I must be missing one step or something. Im unsure if Im supposed to build the app in blynk first, then flash after or flash the auth code then be able to build the app and have it work. Sorry to keep bothering on this thread but Ive given it a week or so of reading and forums and a new particle issued photon and I just need a little more help getting my photon flashed if anyone is willing to help.
I wanted to try Blynk out on a Photon and I was able to make it work just a few minutes ago. (I came here looking for other Photon-related projects/instructions/inspiration).
Can you elaborate on what kind of error you are getting and where? Is it in the Web-based IDE at Particle? Is it in the Blynk app?
If itās in the IDE, you might try posting in the specific error either here or in the Particle forums.
I followed essentially Pavelās instructions with one exception. I created a project first and then went to libraries and added the Blynk library to the (empty) project. I still clicked the āUse this exampleā button and edited the auth token.
It verified and flashed fine for me (it took a little longer than normal to flash since it was a brand-new Photon and doing an update).
Its in the Particle IDE: I just edited my issue above so maybe read another time through. Did you build the app then post the auth token Im wondering if my order is off?
I can flash the code fine without the auth token. When I paste the auth token into the code where it says
char auth[] I get the following error:
In file included from blynk/BlynkSparkCore.h:16:0,
from blynk/BlynkSimpleSparkCore.h:14,
from sparkcore.cpp:18:
blynk/BlynkApiSparkCore.h:74:6: warning: #warning āanalogInputToDigitalPin not defined => Named analog pins will not workā [-Wcpp] #warning āanalogInputToDigitalPin not defined => Named analog pins will not workā
^
sparkcore.cpp:22:11: error: unable to find numeric literal operator āoperator"" d4759bbb456d39b56de440306lfb6ā -
^
sparkcore.cpp: In function āvoid setup()ā:
sparkcore.cpp:33:17: error: āauthā was not declared in this scope
// Attach a Gauge widget to Analog pin 2
^
So, this is a cryptic message, but what you wrote gave me a hint. I was able to reproduce your error in my code if I took the quotes out from the auth token.
You probably did this: char auth[] = d4759bbb456d39b56de440306lfb6;
What you want is more like this: char auth[] = "d4759bbb456d39b56de440306lfb6";
Try wrapping your auth token in quotes and re-flashing. See if that helps.
Also, that appears to be your auth token, and now someone could (Iām not sure whyā¦) put that into their app. If youāre super security-conscious you might want to create a new Project in Blynk on your mobile.
@rhino tried again with the photon redboard and no luck. The error messages were different as well so there must be a difference between the photon and the sparkfun photon redboard. Hardware wise the chip is also larger on the redboard so they arenāt identical.
blynk/BlynkProtocol.h:325:34: error: there are no arguments to 'ntohs' that depend on a template parameter, so a declaration of 'ntohs' must be available [-fpermissive]
hdr.msg_id = ntohs(hdr.msg_id);
^
The Photon RedBoard uses the P1 module, which is a little different then the P0 on the Photon boards. Tested one here and getting the same errors as Pavel got. We are looking more into it! Thanks for letting us know.