Difference: InstallationOfPicoweb (2 vs. 3)

Revision 32020-01-25 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="AFNOGWorkshop2020"

Installing the picoweb server

Line: 38 to 38
 
  • modify yourNetworkName and yourNetworkPassword to adapt the script to your WiFi SSID and password and upload the modified script to the ESP32
  • on the ESP32:
    import wifi_connect
    wifi_connect.connect()
    will connect to your WiFi network and print the IP address of the WEB server.
  • In example_webapp.py modify
    app = picoweb.WebApp(__name__, ROUTES) to app = picoweb.WebApp(None, ROUTES)
Changed:
<
<
  • add host="xxx.xxx.xxx.xxx" to app.run where xxx.xxx.xxx.xxx must be replaced by the IP address you get from wifi_connect. In may case:
    app.run(debug=1,host="192.168.1.49")
>
>
  • add host="xxx.xxx.xxx.xxx" to app.run where xxx.xxx.xxx.xxx must be replaced by the IP address you get from wifi_connect. In may case:
    app.run(debug=1,host="192.168.1.70")
 
  • copy example_webapp.py to the ESP32
  • on the ESP32:
    import picoweb
    will start the WEB server
A few screen dumps show the procedure:
Added:
>
>
First we run wifi_connect.connect() and check the IP address obtained:

picowebRun.png

As ca be seen from the screen dump above, the IP address obtained is 192.168.1.70. This address is added to the app:run (debug=1) called as described above. When importing example_webapp the WEB server is started (see screen dump above). We can also see that port 8081 is used for the WEB server. This URL (192.168.1.70:8081) we enter into the WEB browser and get:

picowebExApp.png

Clicking on squares will display the first 5 square numbers as calculated in templates/squares.tpl:

squares.png

When clicking on source we see the source file of example_webapp:

picowebPrintFile.png

This tells us that the WEB server is now up and running and we can now continue testing the examples in the examples directory before putting our attention to the camera part of the project.

 -- Uli Raich - 2020-01-24

Comments

Line: 51 to 69
 
META FILEATTACHMENT attachment="esp32Modules.png" attr="" comment="" date="1579876355" name="esp32Modules.png" path="esp32Modules.png" size="24259" user="UliRaich" version="1"
META FILEATTACHMENT attachment="uasyncioMod.png" attr="" comment="" date="1579876356" name="uasyncioMod.png" path="uasyncioMod.png" size="37271" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="wifiConnect.png" attr="" comment="" date="1579946577" name="wifiConnect.png" path="wifiConnect.png" size="46989" user="UliRaich" version="1"
META FILEATTACHMENT attachment="picowebStart.png" attr="" comment="" date="1579946578" name="picowebStart.png" path="picowebStart.png" size="30299" user="UliRaich" version="1"
META FILEATTACHMENT attachment="picowebRun.png" attr="" comment="" date="1579946579" name="picowebRun.png" path="picowebRun.png" size="49847" user="UliRaich" version="1"
META FILEATTACHMENT attachment="picowebPrintFile.png" attr="" comment="" date="1579946580" name="picowebPrintFile.png" path="picowebPrintFile.png" size="96602" user="UliRaich" version="1"
META FILEATTACHMENT attachment="squares.png" attr="" comment="" date="1579946580" name="squares.png" path="squares.png" size="33253" user="UliRaich" version="1"
META FILEATTACHMENT attachment="picowebExApp.png" attr="" comment="" date="1579947005" name="picowebExApp.png" path="picowebExApp.png" size="30685" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback