Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Changed: | ||||||||
< < | Once we have collected data from the sensors we want to get access to them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we also want to plot the data in some form or another. Often it is also desired to see real time data. | |||||||
> > | Once we have collected data from the sensors, we want to get access to them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we want to plot the data in some form or another. Often it is also desired to see real-time data. | |||||||
WiFiThe WeMos D1 mini ESP32 CPU board offers WiFi access implementing a TCP/IP and full 802.11 b/g/n Wi-Fi MAC protocol (see the ESP32 data sheet![]() ![]() | ||||||||
Changed: | ||||||||
< < | Before looking into the WEB server we must first make sure we have Internet access through WiFi.The following screen dump shows an interactive MicroPython session where WiFi access is granted: | |||||||
> > | Before looking into the WEB server, we must first make sure we have Internet access through WiFi.The following screen dump shows an interactive MicroPython session where WiFi access is granted: | |||||||
![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Line: 39 to 39 | ||||||||
When collecting data it may be interesting to transfer them for analysis to a PC. For this an FTP server is very helpful and there is one included in the MicroPython binary. Make sure you are connected to the network with wifi_connect and then simply import uftpd. You may stop the server again with uftpd.stop(). More information about the ftp server can be found at https://github.com/robert-hh/FTP-Server-for-ESP8266-ESP32-and-PYBD ![]() | ||||||||
Added: | ||||||||
> > | TelnetA simple telnet server is included in the MicroPython binary. To start it: import utelnetserverutelnetserver.start() Once started you can telnet to the ESP32 and connect to its REPL. Attention: This does NOT work when running the shell in thonny! Here is an example: ![]() | |||||||
Exercises for the Internet part of the IoT courseIn this course we will have a look into two ways of accessing our data: | ||||||||
Line: 56 to 69 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Line: 36 to 36 | ||||||||
Exercises for the Internet part of the IoT courseIn this course we will have a look into two ways of accessing our data: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet accessOnce we have collected data from the sensors we want to get access to them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we also want to plot the data in some form or another. Often it is also desired to see real time data.WiFi | ||||||||
Changed: | ||||||||
< < | Before doing anything on the Internet we must first connect the ESP32 to the WiFi network. The module: | |||||||
> > | The WeMos D1 mini ESP32 CPU board offers WiFi access implementing a TCP/IP and full 802.11 b/g/n Wi-Fi MAC protocol (see the ESP32 data sheet![]() ![]() ![]() | |||||||
https://iotworkshop.africa/pub/IoT_Course_English/InternetAccess/wifi_connect_public.py.txt | ||||||||
Changed: | ||||||||
< < | provides all necessary functions to do this. It first connects to WiFi as a station interface and print the IP address it is connected to. If it is already connected it simply returns. Once connected it gets the current time from the NTP time server and sets up the ESP32 real time clock. You can get the current GMT time with gmtTime() or CET time with cetTime(). The module is already included in the MicroPython binary. | |||||||
> > | provides all necessary functions to do this. It first connects to WiFi as a station interface and prints the IP address it is connected to. If it is already connected it simply returns. Once connected it gets the current time from the NTP time server and sets up the ESP32 real time clock. You can get the current GMT time with gmtTime() or CET time with cetTime(). The module is already included in the MicroPython binary. | |||||||
![]() | ||||||||
Line: 19 to 25 | ||||||||
Since I cannot know the SSID and password of your WiFi network, connect() will only work for my private network. You can however pass your SSID and password as parameters: connect(ssid="YourSSID",password="YourWiFiPasswword") | ||||||||
Changed: | ||||||||
< < | You can get the IP address allocate with | |||||||
> > | You get the IP address allocate with | |||||||
getIPAddress().
An FTP server | ||||||||
Line: 42 to 48 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Line: 41 to 41 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Line: 7 to 7 | ||||||||
Before doing anything on the Internet we must first connect the ESP32 to the WiFi network. The module: | ||||||||
Changed: | ||||||||
< < | https://iotworkshop.africa/pub/IoT_Course_English/InternetAccess/wifi_connect.py.txt | |||||||
> > | https://iotworkshop.africa/pub/IoT_Course_English/InternetAccess/wifi_connect_public.py.txt | |||||||
Changed: | ||||||||
< < | provides all necessary functions to do this. It first connects to WiFi as a station interface and print the IP address it is connected to. If it is already connected it simply returns. Once connected it gets the current time from the NTP time server and sets up the ESP32 real time clock. You can get the current GMT time with gmtTime() or CET time with cetTime(). | |||||||
> > | provides all necessary functions to do this. It first connects to WiFi as a station interface and print the IP address it is connected to. If it is already connected it simply returns. Once connected it gets the current time from the NTP time server and sets up the ESP32 real time clock. You can get the current GMT time with gmtTime() or CET time with cetTime(). The module is already included in the MicroPython binary. | |||||||
![]() | ||||||||
Changed: | ||||||||
< < | which corresponds to the 7th of May 2020 at 9:44:33 GMT. | |||||||
> > | You can also get the current date and time in a more readable format with dateString(currentTime), where currentTime is the tuple returned by gmtTime() or cetTime()
![]() connect(ssid="YourSSID",password="YourWiFiPasswword") You can get the IP address allocate with getIPAddress(). | |||||||
An FTP serverWhen collecting data it may be interesting to transfer them for analysis to a PC. For this an FTP server is very helpful and there is one included in the MicroPython binary. Make sure you are connected to the network with wifi_connect and then simplyimport uftpd. You may stop the server again with uftpd.stop(). | ||||||||
Line: 32 to 40 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Line: 14 to 14 | ||||||||
![]() | ||||||||
Added: | ||||||||
> > | An FTP serverWhen collecting data it may be interesting to transfer them for analysis to a PC. For this an FTP server is very helpful and there is one included in the MicroPython binary. Make sure you are connected to the network with wifi_connect and then simplyimport uftpd. You may stop the server again with uftpd.stop(). More information about the ftp server can be found at https://github.com/robert-hh/FTP-Server-for-ESP8266-ESP32-and-PYBD ![]() | |||||||
Exercises for the Internet part of the IoT courseIn this course we will have a look into two ways of accessing our data: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Internet access | ||||||||
Changed: | ||||||||
< < | Once we have collected data from the sensors we want to get access o them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we also want to plot the data in some form or another. Often it is also desired to see real time data. | |||||||
> > | Once we have collected data from the sensors we want to get access to them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we also want to plot the data in some form or another. Often it is also desired to see real time data.
WiFiBefore doing anything on the Internet we must first connect the ESP32 to the WiFi network. The module: https://iotworkshop.africa/pub/IoT_Course_English/InternetAccess/wifi_connect.py.txt provides all necessary functions to do this. It first connects to WiFi as a station interface and print the IP address it is connected to. If it is already connected it simply returns. Once connected it gets the current time from the NTP time server and sets up the ESP32 real time clock. You can get the current GMT time with gmtTime() or CET time with cetTime().![]() Exercises for the Internet part of the IoT course | |||||||
In this course we will have a look into two ways of accessing our data:
| ||||||||
Line: 12 to 24 | ||||||||
Comments | ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Internet accessOnce we have collected data from the sensors we want to get access o them. This can be accomplished most easily by transferring the data over the Internet. Most of the time we also want to plot the data in some form or another. Often it is also desired to see real time data. In this course we will have a look into two ways of accessing our data:
![]() Comments |