LoRaWAN OTAA TTN Timedout with Gateway capturing the message - lora

I try to set up an end node in LoRaWAN.
I use the board b_l072z_lrwan1 from ST Microelectronics with Zephyr OS.
I use PlatformIO on VSCode.
I use the code available on GitHub at https://github.com/fcgdam/zLorawan_Node.
Here is what I see on my gateway (all EUIs will be changed) :
{
"name": "gs.up.receive",
"time": "2021-10-26T12:54:26.556184636Z",
"identifiers": [
{
"gateway_ids": {
"gateway_id": "bzm-testing-gateway"
}
},
{
"gateway_ids": {
"gateway_id": "bzm-testing-gateway",
"eui": "B827EBFFFE6F34C2"
}
}
],
"data": {
"#type": "type.googleapis.com/ttn.lorawan.v3.UplinkMessage",
"raw_payload": "ACIiIiIRERERcLPVftAEdD2GalaJt3Y=",
"payload": {
"m_hdr": {},
"mic": "Vom3dg==",
"join_request_payload": {
"join_eui": "1111111122222222",
"dev_eui": "3D7404D07ED5B370",
"dev_nonce": "6A86"
}
},
"settings": {
"data_rate": {
"lora": {
"bandwidth": 125000,
"spreading_factor": 12
}
},
"coding_rate": "4/5",
"frequency": "868500000",
"timestamp": 1014604052,
"time": "2021-10-26T12:54:26.535592Z"
},
"rx_metadata": [
{
"gateway_ids": {
"gateway_id": "bzm-testing-gateway",
"eui": "B827EBFFFE6F34C2"
},
"time": "2021-10-26T12:54:26.535592Z",
"timestamp": 1014604052,
"rssi": -45,
"channel_rssi": -45,
"snr": 9.8,
"uplink_token": "CiEKHwoTYnptLXRlc3RpbmctZ2F0ZXdheRIIuCfr//5vNMIQlMLm4wMaDAiC9d+LBhCnrZWIAiCg7PTYwx0=",
"channel_index": 2
}
],
"received_at": "2021-10-26T12:54:26.553997991Z",
"correlation_ids": [
"gs:conn:01FJY9PGVXJ4SE6B1SF1KDCYR4",
"gs:uplink:01FJYAN3FVJJSC368C2PHTXN93"
]
},
"correlation_ids": [
"gs:conn:01FJY9PGVXJ4SE6B1SF1KDCYR4",
"gs:uplink:01FJYAN3FVJJSC368C2PHTXN93"
],
"origin": "ip-10-100-5-46.eu-west-1.compute.internal",
"context": {
"tenant-id": "CgN0dG4="
},
"visibility": {
"rights": [
"RIGHT_GATEWAY_TRAFFIC_READ",
"RIGHT_GATEWAY_TRAFFIC_READ"
]
},
"unique_id": "01FJYAN3FWYZ8BTA8HKB2VYB2V"
}
For me this means the the gateway receive a good request. Here is my configuration on ZephyrOS.
#define LORAWAN_DEV_EUI { 0x3D, 0x74, 0x04, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 } // LSB Format!
#define LORAWAN_JOIN_EUI { 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22 }
#define LORAWAN_APP_KEY { 0x33, 0xE6, 0xF7, 0xF7, 0x5B, 0x46, 0xD2, 0xDC, 0x7F, 0xC4, 0x7C, 0x5F, 0x94, 0x56, 0x06, 0x43 }
My request times out with errno -116 which is ETIMEOUT
Here is my configuration of the device in TTN:
Do you have any clue of why my request timedout?

I've written the DEV_EUI in LSB However, TTN seems to get it in MSB, it worked when I inverted the order of the bytes.

Related

Prebid - Index video outstream configuration with multiple playerSize in bidders

I would like to create an adUnit video outstream with multiple playserSizes for Index (documentation there
At first I thought to put the playerSize at the adUnit level, but because I want to define multiple playerSizes, I decided to move it at bidder level in params > video > playerSize. Nonetheless it does not work whereas in the documentation it is written
If you are using Index’s outstream player and have placed the video object at the bidder level, you must include the Index required parameters at the bidder level``` (link above)
Here is my prebid configuration
```javascript
{
"code": slotCode,
"sizes": [[1,1],[300,250],[160,600],[300,600],[640,360]],
"bids": [
{
"bidder": "criteo",
"params": {
"networkId": networkId,
"video": {
"playerSize": [640, 480],
"skip": 0,
"playbackmethod": 1,
"placement": 1,
"mimes": [
"video/mp4"
],
"maxduration": 30,
"api": [
1,
2
],
"protocols": [
2,
3
]
}
},
"userId": {...},
"userIdAsEids": [...],
"crumbs": {...}
},
{
"bidder": "index",
"params": {
"siteId": siteId,
"size": [
640,
360
],
"video": {
"playerSize": [640, 480],
"h": 640,
"w": 360,
"protocols": [
2,
3,
5,
6
],
"minduration": 5,
"maxduration": 30,
"mimes": [
"video/mp4",
"application/javascript"
],
"playerSize": [
640,
360
]
}
},
"userId": {... },
"userIdAsEids": [...],
"crumbs": {...}
}
],
"mediaTypes": {
"video": {
"context": "outstream"
}
},
"pubstack": {...}
}
If I use this configuration, I got this error
ERROR: IX Bid Adapter: bid size is not included in ad unit sizes or player size.
Even if my playerSize for index ([640, 360]) is in the adUnit sizes.
I wonder if it is possible for an adUnit to have multiple payerSizes?

GetBlock and all related methods doesn't return an info about transactions

Usually, tronGrid returns blocks with transactions, but as I found today, it's not behaving as needed.
How it works right now:
{
"blockID": "0000000001b16eb8b97ab73b7dc8f161c5f2f786f0937bfed7886baa33926c84",
"block_header": {
"raw_data": {
"number": 28405432,
"txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000",
"witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95",
"parentHash": "0000000001b16eb7a6f39a1523f35db8b4089d5a03f591958beafd139e0949d5",
"version": 24,
"timestamp": 1666102851000
},
"witness_signature": "60c7b8b964f103072b7e0fd33b5df636ef4e06d95bb113184ef3266b691b2cf517091960aba72dcd8d5a1ee40374f2124256ddad445429897b066332964ef8d500"
}
}
And how it works before:
{
"blockID": "0000000001b15f18976aee56ff9490303ec64c2007d6034ca03a7a2caefdab73",
"block_header": {
"raw_data": {
"number": 28401432,
"txTrieRoot": "167b9b1620d76e9855d426453ea726a709582f4ed711701ee22fe730bae3f8d8",
"witness_address": "41cd8d8ad1b4a5bd7afe46949421d2b411a3601717",
"parentHash": "0000000001b15f175dc2a20b8c3b29bbbb50860dc57d54d44eff4b02edf849e6",
"version": 24,
"timestamp": 1666089210000
},
"witness_signature": "b9239d12b2044b1bdfa631115f3c7b9b1c1fc5d37c482809d2c7846d05ab84d61778910a55501f4702fe653b943b22b9270b33151ec15e35aa500388dac0abda01"
},
"transactions": [
{
"ret": [
{
"contractRet": "SUCCESS"
}
],
"signature": [
"56a427e32fc0267a2e469ef85530c3145c7de423c8f20d7e11d85dbff98701bdd599d5a45b58ab4f7fa7f212c2ee3cbb5daa50541a83f67dbff533b7e185331501"
],
"txID": "5fd2335105f68de47b82fe3f8065cb3d1cc8ab437aaee55a5d4e61624113730b",
"raw_data": {
...
},
"raw_data_hex": "0a025f0522084cf822e1795ff17f40a7e6a2d5be305a67080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541989cc89d2df684c69bed3563c0cd8817be0a11e1121541bc0777bd8f50e5e148ef59bdce2b895b754c452e1888890a70c7919fd5be30"
}
]
}
Is there a new feature, or it's a bug?

AWS IoT rule sql select statement

I am trying to write a SQL select statement for my AWS IoT rule to extract the values 'gateway_id and 'rssi' from the following MQTT message:
{
"end_device_ids": {
"device_id": "imd2",
"application_ids": {
"application_id": "pennal"
},
"dev_eui": "004E3A0DF76DC9E9",
"join_eui": "70B3D57ED003CBE8",
"dev_addr": "260BA9D0"
},
"correlation_ids": [
"as:up:01G30W0J4D65P6D50QH1DN3ZQP",
"gs:conn:01G2ZZ7FT9BH6J93WRYS4ATVDM",
"gs:up:host:01G2ZZ7FTN14103H90QN71Q557",
"gs:uplink:01G30W0HXWMES1Z7X7F2MCFMPF",
"ns:uplink:01G30W0HXXJM5PNGJAD0W01GGH",
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01G30W0HXWFR3HNGBZS7XJV15E",
"rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01G30W0J4D18JZW199EM8WERGR"
],
"received_at": "2022-05-14T08:47:25.837680984Z",
"uplink_message": {
"session_key_id": "AYBlRLSz9n83bW3WU3+GfQ==",
"f_port": 1,
"f_cnt": 5013,
"frm_payload": "DiAAAA==",
"decoded_payload": {
"rainmm": 0,
"voltage": 3.616
},
"rx_metadata": [
{
"gateway_ids": {
"gateway_id": "pennal-gw2",
"eui": "AC1F09FFFE057EC6"
},
"time": "2022-05-14T08:47:25.065794944Z",
"timestamp": 114306297,
"rssi": -126,
"channel_rssi": -126,
"snr": -8.25,
"uplink_token": "ChgKFgoKcGVubmFsLWd3MhIIrB8J//4FfsYQ+dnANhoMCJ3Z/ZMGEOPmv6sCIKjZvump7gYqCwid2f2TBhCA568f"
}
],
"settings": {
"data_rate": {
"lora": {
"bandwidth": 125000,
"spreading_factor": 11
}
},
"coding_rate": "4/5",
"frequency": "868100000",
"timestamp": 114306297,
"time": "2022-05-14T08:47:25.065794944Z"
},
"received_at": "2022-05-14T08:47:25.629041670Z",
"confirmed": true,
"consumed_airtime": "0.659456s",
"version_ids": {
"brand_id": "heltec",
"model_id": "cubecell-dev-board-class-a-otaa",
"hardware_version": "_unknown_hw_version_",
"firmware_version": "1.0",
"band_id": "EU_863_870"
},
"network_ids": {
"net_id": "000013",
"tenant_id": "ttn",
"cluster_id": "eu1",
"cluster_address": "eu1.cloud.thethings.network"
}
}
}
I have tried following the documentation here: AWS Documentation but am struggling with the nested part of the message.
my SQL statement at the moment is:
SELECT received_at as datetime, end_device_ids.device_id as device_id,
uplink_message.decoded_payload.rainmm as rainmm, uplink_message.decoded_payload.voltage as
voltage, uplink_message.settings.data_rate.lora.spreading_factor as sprfact,
uplink_message.consumed_airtime as time_on_air ,uplink_message.settings.timestamp as ts,
uplink_message.rx_metadata as rx,(select value gateway_ids from uplink_message.rx_metadata) as gw,
(select value rssi from uplink_message.rx_metadata)as rssi, get((select gateway_id from
uplink_message.rx_metadata),0).gateway_id as gwn FROM 'thethings/lorawan/matt-pennal-ire/uplink'
which returns
{
"datetime": "2022-05-15T12:19:11.947844474Z",
"device_id": "md4",
"rainmm": 5.842001296924288,
"voltage": 3.352,
"sprfact": 8,
"time_on_air": "0.092672s",
"ts": 3262497863,
"rx": [
{
"gateway_ids": {
"gateway_id": "pennal-gw2",
"eui": "AC1F09FFFE057EC6"
},
"time": "2022-05-15T12:19:11.178463935Z",
"timestamp": 3262497863,
"rssi": -125,
"channel_rssi": -125,
"snr": -7.5,
"uplink_token": "ChgKFgoKcGVubmFsLWd3MhIIrB8J//4FfsYQx4jXkwwaDAi/34OUBhCCy9XhAiDY6prg+ckHKgsIv9+DlAYQv8mMVQ=="
}
],
"gw": [
{
"gateway_id": "pennal-gw2",
"eui": "AC1F09FFFE057EC6"
}
],
"rssi": [
-125
]
}
but I would like it to return
{
"datetime": "2022-05-15T12:19:11.947844474Z",
"device_id": "md4",
"rainmm": 5.842001296924288,
"voltage": 3.352,
"sprfact": 8,
"time_on_air": "0.092672s",
"ts": 3262497863,
"gwn":"pennal_gw2"
"rssi":-126
}
Any help to get the values from the nested array would be greatly appreciated!

safeTransferFrom does not transfer etherium to the target. ERC-721

I create a contract with ERC-721 and I try to transfer the token with money. I am using web3.js and openzeppelin. So, The transaction is confirmed, but no money is sent to the target wallet.
Here is the contract buy function;
function buy(uint256 _tokenId) public payable {
address buyer = msg.sender;
require(_isApprovedOrOwner(msg.sender, _tokenId), "ERC721: transfer caller is not owner nor approved");
approve(buyer, _tokenId);
safeTransferFrom(ownerOf(_tokenId), buyer, _tokenId);
}
And here is web3.js :
const buy = (2,2) => {
//Token ID: 2
//Price: 2 ether
contract.methods.buy(2).send({ from: account, value: web3.utils.toWei(2, 'ether') })
}
Here is transaction Response of Buy Function
{
"transactionHash": "0xb4267ac3da9a240dc007c118f710a0c9c1fab7d9eb1fab2097acacaec1ac56ee",
"transactionIndex": 0,
"blockHash": "0xf6b8b8456cc3ac6103f03e747e9ca92ada3b68cc86fd408e6e9e03c07d5bcc55",
"blockNumber": 208,
"from": "0xefd8c34cf80828bd9d7b12256421b0d10d75fa86",
"to": "0x112c6dcedb141d2da934696bf8d6cd460eef111e",
"gasUsed": 83787,
"cumulativeGasUsed": 83787,
"contractAddress": null,
"status": true,
"logsBloom": "0x04000000000000000000000000000000000000000000000000000000000000000000001000000000000010000000000000000000000000000000000000200000000000000000000000000008000000000000000000000000000000000000080000000000020000000000000000000800000000000000000000000010000000000100000000000000000000000000001000000000000000000000000000000000020000000000000000000110000002000000000000000000000000000000000000000002000000000080000000000000000000000000000000000000000020000010000000000000000000000000000000000000008000000000000000200000",
"events": {
"Approval": {
"logIndex": 0,
"transactionIndex": 0,
"transactionHash": "0xb4267ac3da9a240dc007c118f710a0c9c1fab7d9eb1fab2097acacaec1ac56ee",
"blockHash": "0xf6b8b8456cc3ac6103f03e747e9ca92ada3b68cc86fd408e6e9e03c07d5bcc55",
"blockNumber": 208,
"address": "0x112c6dCEDb141D2da934696BF8d6CD460EEf111e",
"type": "mined",
"id": "log_3514a43f",
"returnValues": {
"0": "0xf298d44e534E465727f8E6A02F0E95Fe0d360fbC",
"1": "0x0000000000000000000000000000000000000000",
"2": "2",
"owner": "0xf298d44e534E465727f8E6A02F0E95Fe0d360fbC",
"approved": "0x0000000000000000000000000000000000000000",
"tokenId": "2"
},
"event": "Approval",
"signature": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"raw": {
"data": "0x",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x000000000000000000000000f298d44e534e465727f8e6a02f0e95fe0d360fbc",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
}
},
"Transfer": {
"logIndex": 1,
"transactionIndex": 0,
"transactionHash": "0xb4267ac3da9a240dc007c118f710a0c9c1fab7d9eb1fab2097acacaec1ac56ee",
"blockHash": "0xf6b8b8456cc3ac6103f03e747e9ca92ada3b68cc86fd408e6e9e03c07d5bcc55",
"blockNumber": 208,
"address": "0x112c6dCEDb141D2da934696BF8d6CD460EEf111e",
"type": "mined",
"id": "log_95b82cfe",
"returnValues": {
"0": "0xf298d44e534E465727f8E6A02F0E95Fe0d360fbC",
"1": "0xEFD8C34Cf80828BD9D7B12256421b0d10d75fA86",
"2": "2",
"from": "0xf298d44e534E465727f8E6A02F0E95Fe0d360fbC",
"to": "0xEFD8C34Cf80828BD9D7B12256421b0d10d75fA86",
"tokenId": "2"
},
"event": "Transfer",
"signature": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"raw": {
"data": "0x",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000f298d44e534e465727f8e6a02f0e95fe0d360fbc",
"0x000000000000000000000000efd8c34cf80828bd9d7b12256421b0d10d75fa86",
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
}
}
}
}
I changed my contract buy function like this;
function buy(uint256 _tokenId, address payable _owner, uint256 _amount) public payable {
address payable buyer = msg.sender;
address payable owner = _owner; //<-- *payable (important)
_transfer(ownerOf(_tokenId), buyer, _tokenId);
owner.transfer(_amount); //<--- this function send the amount to the token owner.
}
The problem was solved!
Note: This is a simple contract. If you want to use , please be careful.

How can i stop receiving irrelevant disk_usage metrics while using CloudWatchAgent?

Following is the config.json that I'm using
{
"agent": {
"metrics_collection_interval": 300,
"run_as_user": "root"
},
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}"
},
"metrics_collected": {
"disk": {
"measurement": [
"used_percent"
],
"metrics_collection_interval": 300,
"resources": [
"/"
]
},
"mem": {
"measurement": [
"mem_used_percent"
],
"metrics_collection_interval": 300
}
}
}
}
But using this configuration I am receiving many metrics which i dont need, pasting a sample pic below.
I just need the disk_used_percent metric for device: rootfs and path: /