I’m not sure what’s wrong with your setup, but when I try your code (without a remote server and without analog input tho’ - and instead of a SparkFun LiPo Rider I’m using Particle Power Shield with a 4700mAh LiPo), my Photon comes back after exactly 60 seconds each time.
Can you just check if your selected target version in Particle Build really is0.4.9?
Also just to make sure, put your device into DFU Mode and run particle update to be absolutely sure the system is definetly updated correctly.
What kind of battery are you using? Some power banks just switch off if there is too little current drawn for too long.
To test, try reducing the sleep time to 30sec (or 10sec) or use System.sleep(D7, FALLING, 60) to draw some current while sleeping.
ok, updated of all photons (no core update anymore…)
Batteries are LiPo 4000mAh with protection, the one I’m familiar with. I have the power shield, but reading the forum I saw some had results with it. I’ve not seen if the Power Shield can handle a solar panel yet (the mustached one didn’t
I’m running your D7 Falling to see how it behaves. I’ll report back and will try other methods to see if it works. BTW code around is not functional, I am to find a real fft to make it a SPL.
I’ve had some success with the battery shield (non-mustache version) and a 6W Adafruit solar panel. I’ve got the Photon in deep sleep mode (this makes a big difference for power consumption) for 15 minutes and then it awakes, connects to the wifi and then cloud and eventually publishes Voltage and State of Charge to Thingspeak, afterwhich it goes back to sleep.
I think I have a 5400 mAh battery connected to the battery shield, and it easily lasts through the night.
Initially I did this as a test however I enjoy seeing the data now that I’ve left it in the sun (inside behind a window which does reduce the solar power received). I would like to, in the future, get some other sensor data from it, as well as build / print a proper enclosure and have it outside in the full sun.
@epierre I suppose you’re right, it does better than just last through the night; with an average charge around 87% it does pretty well and can be left without worry of the battery draining.
I also checked this morning and saw that I only have a 2500 mAh battery, and not the Adafruit solar panel, but another Chinese one which gives out similar values. I plug it straight into the 7-20V DC input and it does well in direct sun. I do notice that in the afternoon it battles with indirect sun (and the blue light is not on).
I’ve put up the code I used here, it’s pretty straight forward and obviously you need to have a Thingspeak account (you’ll need to replace the XXXXXXX’s with your own key) ready to publish the data to, if that’s where you want to go.
Here is my setup on the windowsill at home :
The black and white cables come from the solar panel above.
I thought this might be interesting. This is a download of my published solar data for about 3-4 months of operation (pictures in post above). It shows :
daily small spikes for catching the morning sun
large drops in State of Charge from some coding errors (Photon hunting for wifi router and not connecting, not connecting to the cloud, etc. During these events it is in normal power mode but because it is using the radio so much it drains the battery quickly. I’ve since added in some loops to stop the searching after a certain amount of time).
generally pretty good State of Charge and Voltage readings over the long term. Certainly enough to consider adding additional sensors, functionality etc.
I initially started publishing data every couple of minutes but this took too much energy, and getting data points every 15 minutes is more than enough data points per day (could actually do with less).
it would be interesting to use this graph to show winter / summer transition, and perhaps also a UV index result from another sensor…
[quote=“epierre, post:34, topic:3812”]
Are you using shield from Particle or SparkFun ?
[/quote] @epierre I am using the shield from Particle - works like a dream! Good luck wihth your projects and let us know how you get on.
I’m learning ThinkSpeak as I try to understand your code, not that easy, maybe you should put XXX for channel too I’ve learned I must declare fields, yours start at 2 not one, must be legacy code
another question more general, why can’t I reflash the Particle that goes into sleep ? is there a simpler way that making it back to dfu with Tinker ? I also have a spark/flash/status going from started to failed, strange no ?
@epierre - Yes, you would need your own channel number too, from registering on the website. I did start at Field 2 for some strange reason (I think I had another variable in there which I didn’t need). Just make sure that the Fields on Thingspeak and in your code match up.
Not sure I understand the other questions of yours… reflashing to Tinker I normally do through the iPhone app although it is hardly needed as the Photon wakes up from sleep, performs a function and goes back to sleep. If I need to program it then I put it in Safe Mode (which means it is connected to the cloud but not running any code). Device Modes
[quote=“epierre, post:38, topic:3812”]
I also have a spark/flash/status going from started to failed, strange no ?
[/quote] Not sure what is going on here?