Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:laboratoare:2025:lab12 [2026/01/03 22:36]
dan.tudose [Configure the Project]
iothings:laboratoare:2025:lab12 [2026/01/03 23:05] (current)
dan.tudose [Build, flash, test]
Line 212: Line 212:
 </​code>​ </​code>​
  
-Open serial ​output ​and note the printed ​IP address. + 
-From machine on the same LAN, open ''​http://​[device-ip]:[port]''​+The code runs a HTTP static file server backed by LittleFS and auto-started at boot; it serves files from /lfs/www on port 8080 and uses the HTTP server’s static_fs handler. 
 + 
 +In the serial ​shell, you need to run the following commands: 
 + 
 +1. Connect to WiFi: 
 +<​code>​ 
 +wifi scan 
 +wifi connect -s "​SSID"​ -p "​PASS"​ -k 1 
 +wifi status 
 +</​code>​ 
 + 
 +2. Check the webserver is up and running ​and get the board IP address: 
 +<​code>​ 
 +net http 
 +net iface 
 +</​code>​ 
 + 
 +3. Write simple index.html file into ''​/​lfs/​www'':​ 
 +<​code>​fs write /​lfs/​www/​index.html -o 0 3c 68 31 3e 48 69 3c 2f 68 31 3e</​code>​ 
 + 
 +4. Browse: ​http://[board-ip]:8080/ 
  
 Expected: Expected:
-  * browser receives a response containing ​the latest sensor values+  * browser receives a response containing ​"​Hi"​
  
-==== Troubleshooting ==== +<​note>​AssignmentAdd a dynamic HTTP endpoint that serves the current contents of bme_log.dat as an HTML page with a 10second autorefresh. So, if you conect to http://[board-ip]:8080/​bme_log it will automatically serve the contents of the log file.</​note>​
-  * No Wi‑Fi logs: +
-    * raise log level (e.g. default level or module-specific) +
-    * ensure WiFi mgmt is enabled +
-  * No IP address: +
-    * verify DHCP is enabled +
-    * ensure DHCP is started after link is up +
-  * “memory allocation failed” from WiFi adapter: +
-    * reduce concurrent HTTP clients +
-    * reduce buffer sizes (HTTP response buffer) +
-    * avoid repeated dynamic allocations in the HTTP thread +
-    * consider increasing heap pool size only if you have flash/RAM headroom +
-  * Browser connects but gets no response: +
-    * verify socket calls are using Zephyr’s socket headers +
-    * verify server binds to INADDR_ANY on the chosen port +
-    * ensure response includes valid HTTP headers and CRLF+
  
  
iothings/laboratoare/2025/lab12.1767472599.txt.gz · Last modified: 2026/01/03 22:36 by dan.tudose
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0