Skip to content

Instantly share code, notes, and snippets.

@takurx
Created June 13, 2023 07:07
Show Gist options
  • Select an option

  • Save takurx/c3d5ea963dc50dfa1f015d8a2f3a91ee to your computer and use it in GitHub Desktop.

Select an option

Save takurx/c3d5ea963dc50dfa1f015d8a2f3a91ee to your computer and use it in GitHub Desktop.
log trying, fail, Fiware IoT Agent, stm32, cayenne, the things network

Log

convert, image magick

chiya@ujimatsu:~/Downloads$ convert -resize half ./IMG_20210727_155644.jpg ./IMG_20210727_155644_half.jpg 
convert-im6.q16: invalid argument for option `-resize': half @ error/convert.c/ConvertImageCommand/2592.
chiya@ujimatsu:~/Downloads$ convert -resize 2000x1500 ./IMG_20210727_155644.jpg ./IMG_20210727_155644_half.jpg 

mqtt, mosquitto_sub

chiya@ujimatsu:~$ mosquitto_sub -h eu1.cloud.thethings.network -p 1883 -t "#" -u "test-stm32-geetsuku@ttn" -P "NNSXS.6SOVX3SACVIUJPNU4WAD672YHSLOKAV33S6LWKA.2OUFT26PMPNMFFFOJV43LGTJ34H4NBVJYA7TKII3UXRKBMKKT2FA" -d
Client mosq-RoWMpAsU24yGazYFzi sending CONNECT
Client mosq-RoWMpAsU24yGazYFzi received CONNACK (0)
Client mosq-RoWMpAsU24yGazYFzi sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 0, Options: 0x00)
Client mosq-RoWMpAsU24yGazYFzi received SUBACK
Subscribed (mid: 1): 0
......
......
{"end_device_ids":{"device_id":"eui-303636327f397a07","application_ids":{"application_id":"test-stm32-geetsuku"},"dev_eui":"303636327F397A07","join_eui":"70B3D57ED000985F","dev_addr":"260B4A18"},"correlation_ids":["as:downlink:01H2MQNFADF15K0PHVW9SY0SHR","as:up:01H2NP96EJD2KG44RCRJJA5AY1","gs:conn:01H2B2AAKAXS327NWDY5YT8D10","gs:tx_ack:01H2NP96EGKA56GJXJ3FBRGDBB","gs:up:host:01H2B2AAM5H4B60XE6PK06JRCE","gs:uplink:01H2NP95SFDWHR869WC15BZ05E","ns:downlink:01H2NP966J7TA292R9T0A2B8X4","ns:transmission:01H2NP966JDBWDR5X0MPFFS5YM","ns:tx_ack:01H2NP96EH6J1DCRJ3KQYC4TWK","ns:uplink:01H2NP95SHYZV0MZZ5W2A3CRXG","rpc:/ttn.lorawan.v3.AppAs/DownlinkQueuePush:579d94f6-8b6e-4477-8ffe-91ea8ffbd82f","rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01H2NP95SHXZXE2HRR95PG82X7","rpc:/ttn.lorawan.v3.GsNs/ReportTxAcknowledgment:01H2NP96EGFWWCC81F2NBV6H1R","rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01H2NP96EJ90WMQZXPP2EGKD5P","rpc:/ttn.lorawan.v3.NsGs/ScheduleDownlink:01H2NP966KH5WS8YN3WTS2K2TY"],"received_at":"2023-06-11T16:57:56.946358426Z","downlink_sent":{"session_key_id":"AYirYJ+ikw9FiXMjYlBeZQ==","f_port":1,"f_cnt":26,"confirmed":true,"priority":"HIGHEST","correlation_ids":["as:downlink:01H2MQNFADF15K0PHVW9SY0SHR","gs:conn:01H2B2AAKAXS327NWDY5YT8D10","gs:tx_ack:01H2NP96EGKA56GJXJ3FBRGDBB","gs:up:host:01H2B2AAM5H4B60XE6PK06JRCE","gs:uplink:01H2NP95SFDWHR869WC15BZ05E","ns:downlink:01H2NP966J7TA292R9T0A2B8X4","ns:transmission:01H2NP966JDBWDR5X0MPFFS5YM","ns:tx_ack:01H2NP96EH6J1DCRJ3KQYC4TWK","ns:uplink:01H2NP95SHYZV0MZZ5W2A3CRXG","rpc:/ttn.lorawan.v3.AppAs/DownlinkQueuePush:579d94f6-8b6e-4477-8ffe-91ea8ffbd82f","rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01H2NP95SHXZXE2HRR95PG82X7","rpc:/ttn.lorawan.v3.GsNs/ReportTxAcknowledgment:01H2NP96EGFWWCC81F2NBV6H1R","rpc:/ttn.lorawan.v3.NsGs/ScheduleDownlink:01H2NP966KH5WS8YN3WTS2K2TY"]}}
......
......

fiware iot-agent, provisioning

chiya@ujimatsu:~/LoRaWorks/IoTagent-LoRaWAN$ curl -X POST \
>   http://localhost:4061/iot/devices \
>   -H 'Content-Type: application/json' \
>   -H 'fiware-service: atosioe' \
>   -H 'fiware-servicepath: /lorattn' \
>   -d '{
>   "devices": [
>     {
>       "device_id": "eui-303636327f397a07",
>       "entity_name": "LORA-DEVICE",
>       "entity_type": "LoraDevice",
>       "timezone": "Asia/Tokyo",
>       "attributes": [
>         {
>           "name": "temperature_0",
>           "type": "Number"
>         }
>       ],
>       "internal_attributes": {
>         "lorawan": {
>           "application_server": {
>             "host": "eu1.cloud.thethings.network",
>             "username": "test-stm32-geetsuku@ttn",
>             "password": "NNSXS.6SOVX3SACVIUJPNU4WAD672YHSLOKAV33S6LWKA.2OUFT26PMPNMFFFOJV43LGTJ34H4NBVJYA7TKII3UXRKBMKKT2FA",
>             "provider": "TTN"
>           },
>           "dev_eui": "303636327F397A07",
>           "app_eui": "70B3D57ED000985F",
>           "application_id": "test-stm32-geetsuku@ttn",
>           "application_key": "E5DEE0E4A3FF229129686A09CDDF9BB3"
>         }
>       }
>     }
>   ]
> }'

stm32, serial

chiya@ujimatsu:~$ sudo minicom -D /dev/ttyACM0
......
......
VERSION: 44251210                                                               
OTAA                                                                            
DevEui= 30-36-36-32-7F-39-7A-0A                                                 
AppEui= 70-B3-D5-7E-D0-00-98-5A                                                 
AppKey= E5 DE E0 E4 A3 FF 22 91 29 68 6A 09 CD DF 9B BA            
  0s458: PHY txDone                                                             
  5s527: PHY rxTimeOut                                                          
  6s527: PHY rxTimeOut                                                          
 10s484: PHY txDone                                                             
 15s552: PHY rxTimeOut                                                          
 16s552: PHY rxTimeOut                                                          
 20s484: PHY txDone                                                             
 25s552: PHY rxTimeOut                                                          
 26s552: PHY rxTimeOut                                                          
  5s917: PHY rxDone                                                             
JOINED                                                                          
 10s404: PHY txDone                                                             
 15s472: PHY rxTimeOut                                                          
 16s781: PHY rxDone                                                             
 20s404: PHY txDone
......
......

fiware iot-agent, docker-stm32, tutorial

chiya@ujimatsu:~/LoRaWorks/IoTagent-LoRaWAN$ sudo docker-compose -f examples/stm32_ttn_tutorial/docker-compose.yml up
Creating network "stm32_ttn_tutorial_default" with the default driver
Creating volume "stm32_ttn_tutorial_mongo_data" with default driver
Creating volume "stm32_ttn_tutorial_cratedata" with default driver
Creating volume "stm32_ttn_tutorial_redisdata" with default driver
Creating stm32_ttn_tutorial_mongodb_1 ... done
Creating stm32_ttn_tutorial_orion_1   ... done
Creating stm32_ttn_tutorial_iotagent-lora_1 ... done
......
......
iotagent-lora_1  | time=2023-06-11T16:54:36.698Z | lvl=INFO | corr=98460664-6c73-41f7-aa83-3e8bb496afbe | trans=98460664-6c73-41f7-aa83-3e8bb496afbe | op=IoTAgentLoRaWAN.TtnAppService | from=n/a | srv=n/a | subsrv=n/a | msg=New message in topic | comp=IoTAgent v3/test-stm32-geetsuku@ttn/devices/eui-303636327f397a07/up
iotagent-lora_1  | time=2023-06-11T16:54:36.699Z | lvl=DEBUG | corr=98460664-6c73-41f7-aa83-3e8bb496afbe | trans=98460664-6c73-41f7-aa83-3e8bb496afbe | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=atosioe | subsrv=/lorattn | msg=Looking for device with id [eui-303636327f397a07]. | comp=IoTAgent
iotagent-lora_1  | time=2023-06-11T16:54:36.700Z | lvl=DEBUG | corr=98460664-6c73-41f7-aa83-3e8bb496afbe | trans=98460664-6c73-41f7-aa83-3e8bb496afbe | op=IoTAgentNGSI.DomainControl | from=n/a | srv=atosioe | subsrv=/lorattn | msg=response-time: 2 | comp=IoTAgent
iotagent-lora_1  | time=2023-06-11T16:54:36.704Z | lvl=DEBUG | corr=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | trans=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=atosioe | subsrv=/lorattn | msg=Device data found: {"_id":"6485fc3f23970b67b0d54c49","active":[{"name":"temperature_0","type":"Number","object_id":"temperature_0"}],"commands":[],"staticAttributes":[],"subscriptions":[],"creationDate":"2023-06-11T16:54:23.821Z","id":"eui-303636327f397a07","type":"LoraDevice","name":"LORA-DEVICE","service":"atosioe","subservice":"/lorattn","internalId":null,"internalAttributes":{"lorawan":{"application_server":{"host":"eu1.cloud.thethings.network","username":"test-stm32-geetsuku@ttn","password":"NNSXS.6SOVX3SACVIUJPNU4WAD672YHSLOKAV33S6LWKA.2OUFT26PMPNMFFFOJV43LGTJ34H4NBVJYA7TKII3UXRKBMKKT2FA","provider":"TTN"},"dev_eui":"303636327F397A07","app_eui":"70B3D57ED000985F","application_id":"test-stm32-geetsuku@ttn","application_key":"E5DEE0E4A3FF229129686A09CDDF9BBA"}}} | comp=IoTAgent
iotagent-lora_1  | time=2023-06-11T16:54:36.704Z | lvl=INFO | corr=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | trans=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | op=IoTAgentLoRaWAN.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=IOTA provisioned devices: | comp=IoTAgent {"_id":"6485fc3f23970b67b0d54c49","active":[{"name":"temperature_0","type":"Number","object_id":"temperature_0"}],"commands":[],"staticAttributes":[],"subscriptions":[],"creationDate":"2023-06-11T16:54:23.821Z","id":"eui-303636327f397a07","type":"LoraDevice","name":"LORA-DEVICE","service":"atosioe","subservice":"/lorattn","internalId":null,"internalAttributes":{"lorawan":{"application_server":{"host":"eu1.cloud.thethings.network","username":"test-stm32-geetsuku@ttn","password":"NNSXS.6SOVX3SACVIUJPNU4WAD672YHSLOKAV33S6LWKA.2OUFT26PMPNMFFFOJV43LGTJ34H4NBVJYA7TKII3UXRKBMKKT2FA","provider":"TTN"},"dev_eui":"303636327F397A07","app_eui":"70B3D57ED000985F","application_id":"test-stm32-geetsuku@ttn","application_key":"E5DEE0E4A3FF229129686A09CDDF9BBA"}}}
iotagent-lora_1  | time=2023-06-11T16:54:36.704Z | lvl=INFO | corr=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | trans=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | op=IoTAgentLoRaWAN.CayenneLpp | from=n/a | srv=n/a | subsrv=n/a | msg=Decoding CaynneLPP message:[object Object] | comp=IoTAgent
iotagent-lora_1  | time=2023-06-11T16:54:36.705Z | lvl=ERROR | corr=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | trans=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | op=IoTAgentLoRaWAN.CayenneLpp | from=n/a | srv=n/a | subsrv=n/a | msg=Error decoding CaynneLPP message:TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object | comp=IoTAgent
iotagent-lora_1  | time=2023-06-11T16:54:36.705Z | lvl=ERROR | corr=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | trans=7a07cc86-f982-4b9e-85b8-6fcb86cb18c3 | op=IoTAgentLoRaWAN.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=Could not cast message to NGSI | comp=IoTAgent
......
......
chiya@ujimatsu:~/LoRaWorks/IoTagent-LoRaWAN$ sudo docker-compose -f examples/stm32_ttn_tutorial/docker-compose.yml down
Removing stm32_ttn_tutorial_iotagent-lora_1 ... done
Removing stm32_ttn_tutorial_orion_1         ... done
Removing stm32_ttn_tutorial_mongodb_1       ... done
Removing network stm32_ttn_tutorial_default
chiya@ujimatsu:~/LoRaWorks/IoTagent-LoRaWAN$ sudo docker volume rm stm32_ttn_tutorial_cratedata stm32_ttn_tutorial_mongo_data stm32_ttn_tutorial_redisdata
stm32_ttn_tutorial_cratedata
stm32_ttn_tutorial_mongo_data
stm32_ttn_tutorial_redisdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment