Search the Community

Showing results for tags 'esp32'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Test and Measurement
    • Measurement Computing (MCC)
    • Add-on Boards
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions
    • Archived

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 6 results

  1. Required materials ESP32 KOB electronic lock Relay STONE STWI070WT-01 display MFRC522 module Realized function 1. card registration. 2. username and password registration. 3. card swipe to unlock the electronic lock. 4. User name and password to unlock the electronic lock. Connection diagram GUI design Code import mfrc522 import time import _thread from os import uname from machine import Pin, UART #from pyb import UART #import machine suos = Pin(32,Pin.OUT) uart2 = UART(2, baudrate=115200, rx=16,tx=17,timeout=10) ESP32_HSPI_CLOCK = 14 ESP32_HSPI_SLAVE_SELECT = 15 ESP32_HSPI_MISO = 12 ESP32_HSPI_MOSI = 13 ESP32_MFRC522_RST = 5 rx3 = [] rx_name = [] user_id_flag = False password_flag = False temp_id = '' temp_mima = '' personnel_id = {'zbw':[236,230,169,47],'lbw':[19,165,93,4]} personnel_ps = {'zbw':'zbw3366','lbw':'lbwnb'} admin_password = ('yyds') button_cmd = [16,1] edit1_cmd = [16,112] edit2_cmd = [16,113] edit3_cmd = [16,114] if uname()[0] == 'esp32': rdr = mfrc522.MFRC522(ESP32_HSPI_CLOCK, ESP32_HSPI_MOSI, ESP32_HSPI_MISO, ESP32_MFRC522_RST, ESP32_HSPI_SLAVE_SELECT) def do_write(): try: (stat, tag_type) = rdr.request(rdr.REQIDL) if stat == rdr.OK: (stat, raw_uid) = rdr.anticoll() if stat == rdr.OK: print("New card detected") print(" - tag type: 0x%02x" % tag_type) print(" - uid : 0x%02x%02x%02x%02x" % (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3])) print("") if rdr.select_tag(raw_uid) == rdr.OK: key = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] if rdr.auth(rdr.AUTHENT1A, 8, key, raw_uid) == rdr.OK: stat = rdr.write(8, b"\x00\x53\x00\x54\x00\x4F\x00\x4E\x00\x45\x0a\x0b\x0c\x0d\x0e\x0f") rdr.stop_crypto1() if stat == rdr.OK: print("Data written to card") else: print("Failed to write data to card") else: print("Authentication error") else: print("Failed to select tag") except KeyboardInterrupt: print("write error") def do_read(): while True: try: (stat, tag_type) = rdr.request(rdr.REQIDL) if stat == rdr.OK: (stat, raw_uid) = rdr.anticoll() if stat == rdr.OK: print("New card detected") print(" - tag type: 0x%02x" % tag_type) print(" - uid : 0x%02x%02x%02x%02x" % (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3])) print (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3]) print("") if rdr.select_tag(raw_uid) == rdr.OK: key = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] if rdr.auth(rdr.AUTHENT1A, 8, key, raw_uid) == rdr.OK: print("Address 8 data: %s" % rdr.read(8)) for ps in personnel_id: if raw_uid[0:4:1] == personnel_id.get(ps): suos.value(1) print(ps) uart_write(ps, *raw_uid[0:4:1]) time.sleep(3) uart2.sendbreak() break rdr.stop_crypto1() time.sleep(3) suos.value(0) else: print("Authentication error") else: print("Failed to select tag") if uart2.any()>1: rx2 = [] data_name2 = '' bin_data = uart2.read(40) uart2.sendbreak() rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) print(rx2) if rx1[3:5:1] == button_cmd: data_name_len = rx1[6] - 1 data_name = rx2[7:data_name_len+7:1] data_name2 = ''.join(data_name) print(data_name2) if data_name2 == 'back3': return except KeyboardInterrupt: print("read error") def do_read2 (idd): print(idd) while True: try: (stat, tag_type) = rdr.request(rdr.REQIDL) if stat == rdr.OK: (stat, raw_uid) = rdr.anticoll() if stat == rdr.OK: print("New card detected") print(" - tag type: 0x%02x" % tag_type) print(" - uid : 0x%02x%02x%02x%02x" % (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3])) print (raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3]) print("") if rdr.select_tag(raw_uid) == rdr.OK: key = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] if rdr.auth(rdr.AUTHENT1A, 8, key, raw_uid) == rdr.OK: print("Address 8 data: %s" % rdr.read(8)) personnel_id[idd] = raw_uid[0:4:1] uart_write3(*raw_uid[0:4:1]) rdr.stop_crypto1() else: print("Authentication error") else: print("Failed to select tag") if uart2.any()>1: rx2 = [] data_name2 = '' bin_data = uart2.read(40) uart2.sendbreak() rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) if rx1[3:5:1] == button_cmd: data_name_len = rx1[6] - 1 data_name = rx2[7:data_name_len+7:1] data_name2 = ''.join(data_name) print(data_name2) if data_name2 == 'back1': return except KeyboardInterrupt: print("read error") def uart_write(text, *ids): # print(text, *ids) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardname1","text":"'+str(text)+'"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid1","text":"'+str(ids)+'"}>ET') uart2.write('ST<{"cmd_code":"set_visible","type":"widget","widget":"lock1","visible":true}>ET') time.sleep(3) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardname1","text":"''"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid1","text":"''"}>ET') uart2.write('ST<{"cmd_code":"set_visible","type":"widget","widget":"lock1","visible":false}>ET') def uart_write2(text,text2): uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"'+text+'"}>ET') time.sleep(3) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"'+text2+'"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit2","text":"''"}>ET') def uart_write3(*id2): uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"'+str(id2)+'"}>ET') time.sleep(3) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"''"}>ET') def uart_write4(text,text2): uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"login","text":"'+text+'"}>ET') time.sleep(1) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"login","text":"'+text2+'"}>ET') time.sleep(1) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit3","text":"''"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit4","text":"''"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit7","text":"''"}>ET') def uart_write5(): uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"'+str(id2)+'"}>ET') time.sleep(3) uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"cardid","text":"''"}>ET') def card_zhuce(): while True: if uart2.any(): user_id = '' password = '' rx2 = [] rx_num = 0 bin_data = uart2.read(40) uart2.sendbreak() rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) rx_num += 1 data_end = rx_num-5 data_id_st = rx2[8:13:1] data_id_st2 = ''.join(data_id_st) print(data_id_st2) if data_id_st2 == 'edit1': data_id_st3 = rx2[15:data_end:1] data_id_st4 = ''.join(data_id_st3) print(data_id_st4) if data_id_st4 != '': name = True elif data_id_st2 == 'edit2': data_id_st5 = rx2[15:data_end:1] data_id_st6 = ''.join(data_id_st5) if data_id_st6 == admin_password: admin = True uart_write2('Verification passed!','Please place the card!') do_read2(data_id_st4) return def mima_zuce(): temp_id3 = '' temp_mima3 = '' while True: if uart2.any(): user_id = '' password = '' rx2 = [] rx_num = 0 # data_end = 0 bin_data = uart2.read(40) uart2.sendbreak() rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) rx_num += 1 # if (rx2[rx_num] == 'T') and (rx2[rx_num-1] == 'E') and (rx2[rx_num-2] == '>'): # break data_end = rx_num-5 data_id_st = rx2[8:13:1] data_id_st2 = ''.join(data_id_st) print(data_id_st2) if rx1[3:5:1] == button_cmd: data_name_len = rx1[6] - 1 data_name = rx2[7:data_name_len+7:1] data_name2 = ''.join(data_name) print(data_name2) if data_name2 == 'back2': return if data_id_st2 == 'edit3': data_id_st3 = rx2[15:data_end:1] data_id_st4 = ''.join(data_id_st3) print(data_id_st4) user_id_flag = True temp_id3 = data_id_st4 # personnel_ps[temp_id] = raw_uid[0:4:1] elif data_id_st2 == 'edit4': data_id_st5 = rx2[15:data_end:1] data_id_st6 = ''.join(data_id_st5) print(data_id_st6) # if personnel_ps.get(temp_id) == data_id_st6: password_flag = True temp_mima3 = data_id_st6 # personnel_ps[temp_id] = password_flag # print(rx2,user_id_flag,password_flag) elif data_id_st2 == 'edit7': data_id_st5 = rx2[15:data_end:1] data_id_st6 = ''.join(data_id_st5) if (data_id_st6 == admin_password) and (password_flag == True) and (user_id_flag == True): admin = True personnel_ps[temp_id3] = temp_mima3 password_flag = False user_id_flag = False uart_write4('Verification passed!','login was successful!') def password_loin(): temp_id2 = '' temp_mima = '' while True: if uart2.any(): user_id = '' password = '' rx2 = [] rx_num = 0 # data_end = 0 bin_data = uart2.read(40) uart2.sendbreak() rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) rx_num += 1 # if (rx2[rx_num] == 'T') and (rx2[rx_num-1] == 'E') and (rx2[rx_num-2] == '>'): # break data_end = rx_num-5 data_id_st = rx2[8:13:1] data_id_st2 = ''.join(data_id_st) print(data_id_st2) if rx1[3:5:1] == button_cmd: data_name_len = rx1[6] - 1 data_name = rx2[7:data_name_len+7:1] data_name2 = ''.join(data_name) print(data_name2) if data_name2 == 'back4': return if data_id_st2 == 'edit5': data_id_st3 = rx2[15:data_end:1] data_id_st4 = ''.join(data_id_st3) print(data_id_st4) if data_id_st4 in personnel_ps: user_id_flag = True temp_id2 = data_id_st4 elif data_id_st2 == 'edit6': data_id_st5 = rx2[15:data_end:1] data_id_st6 = ''.join(data_id_st5) print(data_id_st6) print(temp_id2) print(personnel_ps) if personnel_ps.get(temp_id2) == data_id_st6: password_flag = True # print(rx2,user_id_flag,password_flag) print(user_id_flag,password_flag) if (password_flag == True) and (user_id_flag == True): uart_write(temp_id2,temp_id2) password_flag = False user_id_flag = False suos.value(1) uart2.write('ST<{"cmd_code":"set_visible","type":"widget","widget":"lock2","visible":true}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit5","text":"''"}>ET') uart2.write('ST<{"cmd_code":"set_text","type":"label","widget":"edit6","text":"''"}>ET') time.sleep(3) # uart_write('student','') suos.value(0) uart2.write('ST<{"cmd_code":"set_visible","type":"widget","widget":"lock2","visible":false}>ET') uart2.sendbreak() while True: if uart2.any()>1: rx2 = [] data_name2 = '' bin_data = uart2.read(40) # time.sleep(1) uart2.sendbreak() # time.sleep(1) rx1 = list(bin_data) for item in rx1: rx2.append(chr(item)) print(rx2) if rx1[3:5:1] == button_cmd: data_name_len = rx1[6] - 1 data_name = rx2[7:data_name_len+7:1] data_name2 = ''.join(data_name) print(data_name2) if data_name2 == 'card1': card_zhuce() elif data_name2 == 'password1': mima_zuce() elif data_name2 == 'card2': do_read() elif data_name2 == 'password2': password_loin() Video demo
  2. Hi to everyone. I have successfully tried to use Pmod ESP32 to upload the other Pmod sensors data into the Thingspeak and used GPIO inside the zybo board to control the LED when some Pmod sensor value is too high or too low. Now, my supervisor asked me and my team to do IoT control. For example, an user pressed the button in the webpage or mobile app, the LED which connected to zybo board can turn on or turn off. My teammate now can send the 1 or 0 data to Thingspeak. Now, I want to use my Zybo baord to receive the Thingspeak data that my teammate has made. I have been searching some tutorials on the website but they all that Arduino based project. Here is the resource I found: And below are what I have tired to create. Here is the block diagram and Vitis code I have write Here are my questions For Zybo baord to achieve the IoT control, should I modify the code I have written, or modify the arduino code shown in the Youtube video above. And how can I integrate together? I think I need to change/modify this part of code (this code is to send the data to thingspeak) in order to allow the zybo to receive the data from thingspeak and achieve the IoT control. But I am not sure. void receiveData(XTime time){ XTime tEnd, tCur; u8 recv_buffer=0; u32 num_received=0; XTime_GetTime(&tCur); tEnd = tCur + (time * COUNTS_PER_SECOND); do { num_received = ESP32_Recv(&ESP32, &recv_buffer,1); if(num_received >0){ num_received = ESP32_Recv(&ESP32, &recv_buffer,1); xil_printf("%c", recv_buffer); } if(tCur == tCur + COUNTS_PER_SECOND){ countdown = countdown -1; } else XTime_GetTime(&tCur); } while (tCur < tEnd); } void setWifiMode(void){ u8 tx[]="AT+CWMODE=3\r\n"; u32 num = strlen((char *) tx); xil_printf((char *) tx); ESP32_SendBuffer(&ESP32, tx, num); usleep(100); receiveData(3); } void connectWifi(void){ u8 tx[] = "AT+CWJAP=\"xxxxxxxxxxx\",\"xxxxxxxxxxxxxxx\"\r\n"; u32 num = strlen((char *) tx); xil_printf((char *) tx); ESP32_SendBuffer(&ESP32, tx, num); usleep(100); receiveData(30); } void establishConnection(void){ u8 tx[] = "AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",80\r\n"; u32 num = strlen((char *) tx); xil_printf((char *) tx); ESP32_SendBuffer(&ESP32, tx, num); receiveData(10); } void cipsend(float temp, u16 co2, u8 light, float humidity){ u8 command[150]; u8 finalcmd[50]; //field1 Ph field2 Temp field3 co2 field4 humidity field5 light sprintf((char*)command, "GET http://api.thingspeak.com/update?api_key=CE8VFL1E8ZJNGZM8&field1=0&field2=%d.%02d&field3=%d&field4=%d.%02d&field5=%d\r\n" ,(int) temp_degc,((int) (temp_degc * 100)) % 100,co2,(int) hum_perrh,((int) (hum_perrh * 100)) % 100,light); u32 length = strlen((char*)command); sprintf((char*)finalcmd, "AT+CIPSEND=%d\r\n", (int)length); u32 cmdlength =strlen((char*)finalcmd); xil_printf("Length %d\r\n", length); xil_printf((char *)finalcmd); ESP32_SendBuffer(&ESP32, finalcmd, cmdlength); sleep(1); xil_printf((char *)command); ESP32_SendBuffer(&ESP32, command, length); receiveData(4); } Thanks helloworld1029. Cpp Code Update 1.txt
  3. Hi everyone, I bought a PmodESP32 evaluation board to test the ESP32 module. In my project I would like to use classic bluetooth (no low energy). When I power up the system and do a scan with a smartphone, the ESP32 module does not appear. If I try to use the AT commands (AT + BTINIT ...) the module replies with an error message. I'm pretty sure the system firmware needs to be updated, so i tried to do a firmware upload but without success. I used various software (Arduino, ESP DOWNLOAD TOOL V3.8.5) but during the procedure it seems that the module is not recognized. How can I proceed to update the ESP32-WROOM-32 module ? Thank you
  4. Hey All, I am trying to make a simple IP block design in Vivado 2018.3 to test the ESP32 PMOD out using AT commands for data transmission. I will attach a picture of my current block diagram to this post. I am getting a critical error (reference below) that says the IP has a packaged board value of "digilentinc.com:cora-z7-10:part0:1.0" which is for the Zybo z7 board. My questions are: Q1)Will this design work regardless of this error, as the Zybo and Zed boards are similar and both run off the zynq-7 architecture? Q2)If the answer to Q1 is "no", is there a method of adapting this IP for the Zedboard? (I should be using the latest IP library from Digilent) [IP_Flow 19-4965] IP PmodESP32_axi_gpio_0_0 was packaged with board value 'digilentinc.com:cora-z7-10:part0:1.0'. Current project's board value is 'digilentinc.com:zedboard:part0:1.0'. Please update the project settings to match the packaged IP.
  5. elAmericano

    pmod esp32

    Hello, I am working with Artix A7 board, implementing various PMODs successfully. I am having some issue with PMOD-ESP32 unfortunately. The source files from a project off github (ESP32.c/ESP32.h) from https://github.com/mitchellorsucci/PMODESP32 as well as the included libraries (PmodESP32.c/PmodESP32.h) GitHub Project: I believe the following macros need to be re-defined in the ESP32.h file from github, however in XILINX project for Artix A7, there is a uart-lite that is connected via AXI and there is a uart connected to the ESP32 IP. I have tried to define both. When I define this as the uart-lite device ID, I get some output on console, but I cannot successfully connect to WIFI (which makes me believe the AT commands are being sent to AXI-UART , but not to ESP32 device uart). When I define uart_device as ESP device, nothing prints to console terminal. Please let me know if you have any suggestion. #define UARTLITE_DEVICE_ID XPAR_UARTLITE_1_DEVICE_ID #define INTC_DEVICE_ID XPAR_INTC_0_DEVICE_ID #define UARTLITE_INT_IRQ_ID XPAR_INTC_0_UARTLITE_1_VEC_ID When I try to use the PmodESP32.h / PmodESP32.c included with IP, I am also not able to succesfully communicate with device. I basically do the following ESP32_HardwareEnable(ESP32); ESP32_Initialize(ESP32, u32 UartBaseAddr, u32 GpioBaseAddr); ESP32_HardwareReset(ESP32); ESP32_SendBuffer(ESP32, u8 *buffer, u32 count); The commands i try to send are for connecting to WIFI and for configuring TCP, the functions return 0, which i understand means not succesful. I have reconfigure some of the functions from the github project to work with PmodESP32.c/PmodESP32.h files (the github project uses a UART only devicePtr, whereas the included PmodESP32 files have GPIO / UART structure). int set_wifi_mode(PmodESP32 * devicePtr, unsigned int mode) { u8 tx_buf[50]; if(mode > 3) { xil_printf("Mode %d is not supported for setting the WiFi mode\n\r"); xil_printf("Please Use Modes:\n\r"); xil_printf("\tNULL_MODE\n\r\tSTATION_MODE\n\r\tSOFTAP_MODE or\n\r\tSOFTAP_AND_STATION_MODE\n\r"); return XST_FAILURE; } sprintf(tx_buf, "AT+CWMODE=%d", mode); ESP32_SendBuffer(devicePtr, tx_buf, strlen(tx_buf)); send_n_clr(devicePtr); return XST_SUCCESS; } int get_current_AP(PmodESP32 * devicePtr) { u8 tx[] = "AT+CWJAP?"; ESP32_SendBuffer(devicePtr, tx, strlen(tx)); send_n_clr(devicePtr); return XST_SUCCESS; } int set_current_AP(PmodESP32 * devicePtr, char * ssid, char * pwd, char * bssid) { u8 tx_buf[100]; sprintf(tx_buf, "AT+CWJAP=\"%s\",\"%s\"", ssid, pwd); if(bssid != NULL) { int cursor = strlen(tx_buf); sprintf(tx_buf + cursor, ",\"%s\""); } ESP32_SendBuffer(devicePtr, tx_buf, strlen(tx_buf)); sendNLCR(devicePtr); return XST_SUCCESS; } int list_available_APs(PmodESP32 * devicePtr, char * ssid) { u8 tx_buf[100]; sprintf(tx_buf, "AT+CWLAP"); if(ssid != NULL) { int cursor = strlen(tx_buf); sprintf(tx_buf + cursor, "=\"%s\"", ssid); } ESP32_SendBuffer(devicePtr, tx_buf, strlen(tx_buf)); sendNLCR(devicePtr); return XST_SUCCESS; } ESP32.c ESP32.h PmodESP32.c PmodESP32.h
  6. elAmericano

    ESP32

    Hello, I am working on integrating ESP32 PMOD into a vivado 2018.2 project. I have imported DIgilent IP library into Vivado. When I place PMOD and connect to board, during compilation. It is actually a general message from the block design (See attached image). It apperas to me that this IP is for ArtyZ7? or some other Zync product? If so, is there IP available for Arty A7 or is this message to be ignored?