This repository was archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
[General] <Green Grass Discovery Demo> #3453
Copy link
Copy link
Open
Labels
Description
Hello Folks,
I have been trying to get green grass discovery demo working on ESP32-WROVER hardware but couldn't not get any resource of green grass device v2.
Hardwares Used:
- Raspberry Pi3 [RPi]
- ESP32-WROVER
Steps I followed to setup GGC on RPi:
- Setup Raspberry Pi with Raspbian buster and installed Java
- Created a user on AWS IAM console with policies i.e.
IAMFullAccess
AmazonS3FullAccess
AWSGreengrassFullAccess
AWSIoTFullAccess
- Downloaded AWS Secret Key and AWS Access Key of user
- Exported AWS Secret Key and AWS Access Key in RPi
- Setup green grass core device in RPi [https://docs.aws.amazon.com/greengrass/v2/developerguide/getting-started.html]
- Downloaded green grass installer, run it and successfully installed Nucleus as system service in RPi
- Checked and verified by command : sudo /greengrass/v2/bin/greengrass-cli component list
and it was showing aws.greengrass.cli component's status as Running - Then added a new component for publish and subscribe to AWS IoT core by creating recipes and artifacts. Component was deployed and successfully running. I could publish and subscribe to AWS IoT core.
Steps I followed to setup GGC Discovery Demo on ESP32:
- Setup python and python-pip on windows PC
- Downloaded AWS CLI and installed on windows PC
- Configured AWS user configuration using command : aws configure and configured AWS Access Key, AWS Secret Key, Region and default data format [json].
- Cloned amazon-freertos
git clone https://github.com/aws/amazon-freertos.git --recurse-submodules
cd amazon-freertos
git fetch --all –tags - Installed ESP-IDF dependencies : amazon-freertos/vendors/espressif/esp-idf & run:
install.bat - Setup ESP-IDF environment: amazon-freertos/vendors/espressif/esp-idf & run:
export.bat - Setup AWS configuration i.e. Things name, Wi-Fi SSID and Password in configure.json from amazon-freertos/tools/aws_config_quick_start path
- Run : python SetupAWS.py setup to setup thing and AWS credentials
- Run: python SetupAWS.py update_creds to update AWS credentials
- Replaced CONFIG_CORE_MQTT_MUTUAL_AUTH_DEMO_ENABLED with the CONFIG_GREENGRASS_DISCOVERY_DEMO_ENABLED in vendors/espressif/boards/esp32/aws_demos/config_files/aws_demo_config.h
- In amazon-freertos root directory: built demo using below command
**idf.py -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 build**
12 .Flashed and monitored firmware using idf.py -p COM3 flash monitor
But not getting green grass device information 😕 Don't know what was the mistake !
Attaching logs of ESP32 monitoring.
Can anyone point me about the possible issue/s and probably solution !?
Thanks.
Jitendra
Hard resetting via RTS pin...
Executing action: monitor
Running idf_monitor in directory c:\amazon-freertos
Executing "C:\Users\Jitendra\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:\amazon-freertos\vendors\espressif\esp-idf\tools/idf_monitor.py -p COM5 -b 115200 --toolchain-prefix xtensa-esp32-elf- c:\amazon-freertos\build\aws_demos -m 'C:\Users\Jitendra\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe' 'C:\amazon-freertos\vendors\espressif\esp-idf\tools\idf.py' '-p' 'COM5'"...
--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM5 instead...
C:\amazon-freertos\vendors\espressif\esp-idf\tools/idf_monitor.py:474: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if StrictVersion(serial.VERSION) < StrictVersion('3.3.0'):
--- idf_monitor on \\.\COM5 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7488
load:0x40078000,len:13724
load:0x40080400,len:4584
0x40080400: _init at ??:?
entry 0x400806f4
I (26) boot: ESP-IDF v4.2.2-273-g9e3992ead 2nd stage bootloader
I (27) boot: compile time 17:47:09
I (27) boot: chip revision: 1
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (38) boot.esp32: SPI Speed : 40MHz
I (42) boot.esp32: SPI Mode : DIO
I (47) boot.esp32: SPI Flash Size : 4MB
I (51) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (60) boot: ## Label Usage Type ST Offset Length
I (68) boot: 0 nvs WiFi data 01 02 00010000 00006000
I (75) boot: 1 otadata OTA data 01 00 00016000 00002000
I (83) boot: 2 phy_init RF data 01 01 00018000 00001000
I (90) boot: 3 ota_0 OTA app 00 10 00020000 00177000
I (98) boot: 4 ota_1 OTA app 00 11 001a0000 00177000
I (105) boot: 5 storage WiFi data 01 02 00317000 00010000
I (113) boot: End of partition table
I (117) boot: ota rollback check done
I (121) boot_comm: chip revision: 1, min. application chip revision: 0
I (128) esp_image: segment 0: paddr=0x00020020 vaddr=0x3f400020 size=0x28528 (165160) map
I (200) esp_image: segment 1: paddr=0x00048550 vaddr=0x3ffbdb60 size=0x03994 ( 14740) load
I (207) esp_image: segment 2: paddr=0x0004beec vaddr=0x40080000 size=0x0412c ( 16684) load
0x40080000: _WindowOverflow4 at c:\amazon-freertos\build/../freertos_kernel/portable/ThirdParty/GCC/Xtensa_ESP32/xtensa_vectors.S:1860
I (214) esp_image: segment 3: paddr=0x00050020 vaddr=0x400d0020 size=0xa8cf0 (691440) map
0x400d0020: _stext at ??:?
I (479) esp_image: segment 4: paddr=0x000f8d18 vaddr=0x4008412c size=0x18b70 (101232) load
0x4008412c: coex_core_release at ??:?
I (539) boot: Loaded app from partition at offset 0x20000
I (539) boot: Disabling RNG early entropy source...
I (540) cpu_start: Pro cpu up.
I (543) cpu_start: Application information:
I (548) cpu_start: Project name: amazon-freertos
I (554) cpu_start: App version: 1
I (558) cpu_start: Compile time: Feb 3 2022 17:46:30
I (564) cpu_start: ELF file SHA256: 79aa8361c3c5bbb5...
I (570) cpu_start: ESP-IDF: v4.2.2-273-g9e3992ead
I (576) cpu_start: Single core mode
I (581) heap_init: Initializing. RAM available for dynamic allocation:
I (588) heap_init: At 3FF80000 len 00002000 (8 KiB): RTCRAM
I (594) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (600) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (606) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (612) heap_init: At 3FFCAD38 len 000152C8 (84 KiB): DRAM
I (619) heap_init: At 3FFE0440 len 0001FBC0 (126 KiB): D/IRAM
I (625) heap_init: At 40078000 len 00008000 (32 KiB): IRAM
I (631) heap_init: At 4009CC9C len 00003364 (12 KiB): IRAM
I (637) cpu_start: Pro cpu start user code
I (655) spi_flash: detected chip: generic
I (656) spi_flash: flash io0 0 [main] Initializing lwIP TCP stack
I (676) PKCS11: Initializing NVS partition: "storage"
E (686) PKCS11: failed nvs get file size 4354 0
1 9 [main] Write certificate...
2 22 [iot_thread] [INFO ][DEMO][220] ---------STARTING DEMO---------
I (886) BTDM_INIT: BT controller compile version [bfbbe1e]
3 22 [iot_thread] [INFO ][INIT][220] SDK successfully initialized.
I (896) system_api: Base MAC address is not set
I (896) system_api: read default base MAC address from EFUSE
I (906) phy_init: phy_version 4660,0162888,Dec 23 2020
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=187 adv_itvl_max=375
I (1306) wifi:wifi driver task: 3ffd9374, prio:23, stack:6656, core=0
I (1306) wifi:wifi firmware version: df5b09d
I (1306) wifi:wifi certification version: v7.0
I (1306) wifi:config NVS flash: enabled
I (1306) wifi:config nano formating: disabled
I (1316) wifi:Init data frame dynamic rx buffer num: 32
I (1316) wifi:Init management frame dynamic rx buffer num: 32
I (1326) wifi:Init management short buffer num: 32
I (1326) wifi:Init dynamic tx buffer num: 32
I (1336) wifi:Init static rx buffer size: 1600
I (1336) wifi:Init static rx buffer num: 10
I (1336) wifi:Init dynamic rx buffer num: 32
I (1346) wifi_init: rx ba win: 6
I (1346) wifi_init: tcpip mbox: 32
I (1356) wifi_init: udp mbox: 6
I (1356) wifi_init: tcp mbox: 6
I (1356) wifi_init: tcp tx win: 5744
I (1366) wifi_init: tcp rx win: 5744
I (1366) wifi_init: tcp mss: 1440
I (1376) wifi_init: WiFi IRAM OP enabled
I (1376) wifi_init: WiFi RX IRAM OP enabled
I (1386) phy_init: phy_version 4660,0162888,Dec 23 2020
I (1396) wifi:mode : sta (24:0a:c4:44:92:8c)
I (1396) WIFI: WIFI_EVENT_STA_START
I (2656) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (3136) wifi:state: init -> auth (b0)
I (3156) wifi:state: auth -> assoc (0)
I (3156) wifi:state: assoc -> run (10)
I (3206) wifi:connected with Jitendra, aid = 4, channel 6, BW20, bssid = 86:4e:3e:ab:db:52
I (3206) wifi:security: WPA2-PSK, phy: bgn, rssi: -41
I (3206) wifi:pm start, type: 1
I (3216) WIFI: WIFI_EVENT_STA_CONNECTED
I (3266) wifi:AP's beacon interval = 102400 us, DTIM period = 2
I (4166) esp_netif_handlers: sta ip: 192.168.136.84, mask: 255.255.255.0, gw: 192.168.136.65
I (4166) WIFI: SYSTEM_EVENT_STA_GOT_IP
4 350 [sys_evt] [INFO ][DEMO][3500] Connected to WiFi access point, ip address: 255.255.255.0.
5 350 [iot_thread] [INFO ][DEMO][3500] Successfully initialized the demo. Network type for the demo: 1
6 350 [iot_thread] [aws_greengrass_discovery_demo.c:533] [INFO] [Greengrass_Discovery_Demo] Attempting automated selection of Greengrass device
E (4886) PKCS11: failed nvs get file size 4354 0
7 773 [iot_thread] JSON file retrieval completed
8 773 [iot_thread] About to close socket.
9 773 [iot_thread] Socket closed.
10 773 [iot_thread] Stack high watermark for discovery helper task: 7912.
11 773 [iot_thread] JSON parsing: Couldn't find certificate
12 773 [iot_thread] [aws_greengrass_discovery_demo.c:606] [ERROR] [Greengrass_Discovery_Demo] Auto-connect: Failed to retrieve Greengrass address and certificate.
13 773 [iot_thread] [INFO ][DEMO][7730] memory_metrics::freertos_heap::before::bytes::215244
14 773 [iot_thread] [INFO ][DEMO][7730] memory_metrics::freertos_heap::after::bytes::81876
15 774 [iot_thread] [INFO ][DEMO][7730] memory_metrics::demo_task_stack::before::bytes::11992
16 774 [iot_thread] [INFO ][DEMO][7740] memory_metrics::demo_task_stack::after::bytes::7112
I (9406) wifi:state: run -> init (0)
I (9406) wifi:pm stop, total sleep time: 3744775 us / 6192357 us
I (9406) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
I (9406) WIFI: WIFI_EVENT_STA_DISCONNECTED: 63
17 874 [iot_thread] [ERROR][DEMO][8740] Error running demo.
E (9416) wifi_init: Wi-Fi not stop
I (9426) WIFI: WIFI_EVENT_STA_STOP
I (9426) wifi:flush txq
I (9426) wifi:stop sw txq
I (9436) wifi:lmac stop hw txq
I (9436) wifi:Deinit lldesc rx mblock:10
GAP procedure initiated: stop advertising.
GAP procedure initiated: stop advertising.
18 879 [iot_thread] [INFO ][INIT][8790] SDK cleanup done.
19 879 [iot_thread] [INFO ][DEMO][8790] -------DEMO FINISHED-------