Ok, so I got it working :), the above code is fine, it was my php at fault. So, just as a matter of interest, is it ok to use the F macro please ? and seeing as the server doesn’t respond with any data when I send the data in the loop, is it ok to not wait for a response while looping?
Thanks @bko, one final question if you don’t mind. I am sending 32 bytes at a time in my loop. To send a 50K image this takes 32 seconds !
The 50K image takes 7 seconds to send wirelessly from my arduino to my spark using the NRF24L01.
If I could buffer the imahe as it comes in from the arduino into a byte array 50k long, I could then send the entire array at once without having to have a loop. Only problem with this is that the core only has 20K RAM so that is impossible. I have ordered 4 Photons which have 128K RAM. When my Phontons arrive, will I be able to implement my plan to buffer it and send it in one write?
Yes, I think photon will enable larger buffer sizes in situations like this.
I would try sending 1024 bytes at a time and see if that improves things. The maximum WiFi packet size that the Spark Core can handle is just over 1400 bytes, so something around that will lower the amount of overhead processing you have to do. Anything above that will likely just be the same.
Yep, I tried at 1000 bytes per itteration, that cut the time to 17 seconds, I also tried at 5000 but the core said no
I feel I’m pushing the limits of what this little board can do here so I’m glad the Photons are winding their way to me, I think that they will make this and many projects like it viable.
Thanks to you and @Hootie81 for your help, I’d not have been able to do this without you
@rickpbush - I have exactly the same situation. The client part is done however I am struggling with the PHP at the server. Any chance you could share that PHP script?