Hi There,
new to Particle, although familiar with HW and FW programming and done some projects with Arduino etc…
Here is my application but not sure how to address this, in what is related to connectivity.
I will have some local processing where using SPI hw interface I will collect some data from a peripheral. Other peripheral is a I2C lcd, which I will use hw also, if possible.
So far so good, and I see it should be easy. I already saw some tips on hw use of spi, need to check i2c.
Periodically, I will post data to a local webserver, using a simple post, which will of course write on a DB.
My concern is the connectivity, and I think it is related to my lack of knowledge on this cloud service.
I understand I can program online, and part is connected to the cloud, which handles the downalod to the core. OK.
What I need is: this device, in real application won’t be connected to the internet but rather to a local network running a webserver, as I mentioned before.
My question is how I setup wifi to connect the module to, and also, how do I load code if I am on local network, and not cloud connected…
The connecting to the db is done using the TCP client and you should find plenty of examples how to use it. Pretty sure I put up a bit of example code a while ago for db stuff for MySQL a search of the forum should find it
There are a few options to flash the device and I’ve always found dfu is the easiest and very quick. Otherwise you could use your phones hot-spot and have the core/photon connect to that to do the update then switch back to the other network
Oh and use system mode semi-auto… turn the Wi-Fi on but don’t call particle connect and you will be fine.
You could connect a switch to call particle.connect that way you can download new code…
For now, I am just not able to even install DFU and it seems nobody there with good ideas…
Windows system…
Problem is one… I am running out of time. I wanted this to be an improvement form system I have already using ESP8266 and other processor… but seems I am out of luck…
Hi there…
Missing only SPI working…
When things work this dam thing is amazing
So I have I2C, TCPClient postingto a local webserver…all good.
I found that a get command takes a bit of time to execute…
Now my problem is I need to have all running not Internet connected.
I tried SEMI-auto, but not sure how to connect wifi only and use TCPClient…
I Made it work few minutes ago, thanks.
Now, why is it so slow if not connected to the cloud? breathing green
Exactly same GET command/function… takes way more time to process…
Any ideas? I cannot do for instance 1 GET per second. If I am cloud connected all is good. And yes, it is working because I see data being added on db.
because of formatting?
I removed dio signalling or lcd messages etc… which is useless for this matter…
I published the important piece.
Also, I guarantee that running this coed with 1sec interval fails in 2-3 cycles (populated was 5sec), whereas, running with Spark.connect instead of WiFi.connect runs smoothly, no problems…
Again I only replace WiFi.connect with Spark.connect… I actually would think that could take more since Spark could be exchanging some data with cloud…
HiScruffR,
all that has been solved.I also installed the toolchain… but trying to stay of that for now.
I am using DFU mode already, sice sometimes I get into manual mode or semi-auto and need to reflash using dfu.
All that is perfect. Thanks for the info anyway.
I'd not use the IP as hostname. Rather put it into request.ip = IPAddress(), otherwise you'll have a DN resolution attempt that will fail anyhow - this might well be the cause for the delay.
With Particle.connect() the TCP connection will be kept alive, while I'm not sure if HTTPClient does the same.
I can't see declarations for update_db_ready, aa and headers - so this code can't run (as @Moors7 pointed out already).
Can you test the code you posted and see if any of the problems go away? (e.g. crash, red blink)
If you've got a Photon, you've got Safe Mode to allow for OTA even if application fw would not get connected.
Got any link to such a topic? Since this is intended behaviour I'd be surprised if others would expect it to be any different.
Nope! When we want SPARK_CLOUD_CONNECT = 1; WiFi cannot be asleep, but without cloud we can start off with sleeping WiFi, but WiFi.on() or WiFi.connect() will wake WLAN but not connect to cloud - meaning SPARK_CLOUD_CONNECT = 0andSPARK_WLAN_SLEEP = 0.
You'd have to see under what circumstances it gets set.
I know D7 is output only, but I would guess since I am not trying to make it input shouldn’t matter???
Yes, functions and variables are declared before.
I will try the ip address thing.Thanks. So just not sure how to do it. IPAdress function will return me Photon address? or how should i use it to return my webserver host?