The command “AT CIPSEND” is used to initiate data transmission and it requires the length of character that to be transmitted. ![]() This is required for the proper functioning of UART and ESP board. The time.sleep() function is used to provide some halt/waiting before execution of the next line. #temperature reading sensor_temp = machine.ADC(4) conversion_factor = 3.3 / (65535)ħ. Later, this 12bit data is converted to a 16bit unsigned integer using Python’s inbuilt function. Note that, ADC of the Pico board is 12 bit. The conversion factor is used to get the scale factor of ADC. The on-chip sensor is connected to ADC-4. ![]() Read internal temperature sensor data of Pico board. send='AT CIPSERVER=1,80' uart.write(send '\r\n') time.sleep(2) res=uartSerialRxMonitor(send) print("Server configured successfully-> " res)Ħ. Also, print the status on the serial monitor of Thonny. #enable multi connection mode send='AT CIPMUX=1' uart.write(send '\r\n') time.sleep(1) res=uartSerialRxMonitor(send) print("Configured as Dual mode ->" res)ĥ. send='AT CWMODE=3' uart.write(send '\r\n') time.sleep(1) #Set SoftAP name send='AT CWSAP="pos_softap","",11,0,3' uart.write(send '\r\n') time.sleep(1) res=uartSerialRxMonitor(send) print(res)Ĥ. If you want, you can set the password within “….” after ‘pos_softap’. Setup name of the Access point using ‘AT CWSAP’, no password is set for the current configuration. Configure ESP-8266 WiFi module in Soft AP Station mode (AT CWMODE=3), send the command to ESP module through UART of Pico. Configure UART of Raspberry Pi Pico with 115200 baud and print status in a serial terminal uart = UART(1,115200) print('- UART Serial -') print('>', end='')ģ. ![]() To maintain synchronization with the ESP8266 WiFi module, the UART of Raspberry Pi Pico is also configured with the same baud rate.įrom machine import UART import machine import _thread import timeĢ. Also, the default baud rate of the ESP module is 115200. There are two inbuilt UART available in Pico. The WiFi module can be configured just by sending these specific commands through the serial port (UART) of Raspberry Pi Pico. The set of AT commands are already preloaded into the program memory of ESP-8266 and does not require additional programming. To avoid these complexities, in this design, AT commands are used. But, this requires additional circuit configuration, a RESET push-button, etc. While using the ESP8266 WiFi module, it requires additional programming, which can be done using a USB to serial converter (FTDI module) and Arduino IDE. The tiny server displays the on-chip temperature sensor reading on a web page running on the web browser of pc/smartphone. Micro Python is used as a programming language using Thonny IDE. Here, the functionality of a simple web server using the ESP8266 WiFi module is demonstrated. A Popular and low-cost ESP 8266 WiFi module is a good choice to solve the connectivity issues of RP2040 pico. ![]() A wide range of flexible I/O options includes I2C, SPI, GPIO.Īlthough it is much faster than Arduino or NodeMCU, one of the limitations of Pico RP2040 is wireless connectivity which is one important requirement for wireless
0 Comments
Leave a Reply. |