How potential buyers could insert WIFI-parameters
we want to develop an iot-device and made our first tries with the GPY. They run ok.
One Problem what we are thinking about ist how a potential buyer, who has no ecperience with programming and u-controller stuff, will be able to insert his wifi- information into our script on the Pycom-board.We want to send the sensor-data by using MQTT. So we need connection to the internet over the wifi the customer has.
Does anyone have experience in the field? Is there a solution?
We thought of programming a mobilephone-app where you can insert this information and sending them via bluetooth to the Board. Ist this possible?
But this would be a great effort.
Does this maybe work with ne Pymate-app(Unfortunately not available for GPY)?
I've ordered some LoPy4. I'll try the same code when they arrive. for the moment I've managed to process POST request by hand, based on the next example, mixed with the given in the page you shared:
Sure I'll get this up ASAP.
Any update (ETA) on this?
The first error is caused by your module running out of RAM, try minimising how much HTML you are presenting to lower the memory requirements.
Secondly can share your
main.pycode so I can check what you are trying to run.
Hi @seb, here there are the captures from the filezilla client:
On the left side there is the folder clonned from the repo. on the righht side the root folder of the device. I've copied microWebSocket.py, microWebSrv.py and microWebTemplate.py inside lib/ folder as it follows:
Then I go to Visual Studio Code, and run main.py. The first time throws this message:
And the second time this:
If I check the available memory I get values similar to this:
Am I following the right steps? Or my LoPy is really out of memory?
Thank you in advance, and sorry if I'm distorting the meaning of this thread.
If you could post the whole error message you get, we can help you get it working. Did you copy the library into
Hi @jmarcelino, thank you for your reply. The troubles I have experienced were because of that repository. It seems really great because of the functionalities ot offers, but unfortunately I wasn't able to run even the example it provides. It always fails to import MicroWebSrv (even if I copy all the files to the LoPy flash). Mi theory is that my device runs out of memory, but I cannot prove it since I don't have a LoPy4 (and there is not stock nowadays, at least in Mouser). If you want I'll post the Terminal output after I run the script, to see what it throws. Perhaps there is something more I could have missed.
Actually my attempts to embed a webserver are based on the link that @seb sent. I made a rudimentary function to process GET request, but I am not having luck at detecting POST requests. But I would like to use something more "correct" and standard.
There's a fantastic web server already for MicroPython by Jean-Christophe Bos. Check out https://github.com/jczic/MicroWebSrv
Works perfectly on our boards.
You can run a http server on the device (a good example can be found here: http://docs.micropython.org/en/v1.9.2/esp8266/esp8266/tutorial/network_tcp.html), the sockets available in micropython work just like regular sockets on Windows/Linux and you can read/write the raw GET and POST requests like strings.
I was thinkinkg about doing something similar as your flow, but I am having trouble to implement a micro webserver (I'm using a standard LoPy, not LoPy4). Are you capable of process GET or POST requests on your device? Any suggestion on how can I manage that?
Thanks in advance.
picotui might me another option:
I don't have personal experience yet, however I will probably use it in my products.
Hi @misterlisty, That can be an other way, can you also send more informations than the wifi credential ? like the Lora or Sigfox informations ?
If you could share your code I would like to test it.
Best regards Jiemde
I have a method that works really well, i enable bluetooth and use a standard BLE scanner app to update the wifi credentials..works really well and can share code if you like.
@jmarcelino Great! I'm trying the same but I'm really novice here.. keep us posted ;)
Hi @jmarcelino after some investigations they can read but no write NFC tag, so you're right. But it's work with Androïd without problem
Hi @jmarcelino I thing that the new Iphone have NFC ( from NXP )
i don’t think that strategy works with iPhones
Hi @jmarcelino I' m developping an NFC interface with the NTAG I2C from NXP, so you can transfer the necessary informations with your phone.
@jmarcelino Thank you!
Sure I'll get this up ASAP.