Changes for page AI Image Sensor Calibration
Last modified by Karry Zhuang on 2025/07/03 11:59
From version 151.2
edited by Karry Zhuang
on 2024/05/10 09:53
on 2024/05/10 09:53
Change comment:
There is no comment for this version
To version 136.1
edited by Karry Zhuang
on 2024/04/30 16:52
on 2024/04/30 16:52
Change comment:
Uploaded new attachment "1714467134950-189.png", version {1}
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 4 removed)
Details
- Page properties
-
- Content
-
... ... @@ -307,53 +307,172 @@ 307 307 308 308 = (% title="Click and drag to resize" %)3. Get Sensor Data.(%%) = 309 309 310 +== (% title="Click and drag to resize" %)3.1 Get Digital Reading After Calibration(%%) == 310 310 311 - == (% title="Clickanddragtoresize" %)3.1 Get Image andshowinPC(%%) ==312 +This section shows an example for how to join the [[TheThingsNetwork>>url:https://www.thethingsnetwork.org/]] LoRaWAN IoT server. Usages with other LoRaWAN IoT servers are of similar procedure. 312 312 313 -To get the AIS current image on the PC, you can connect AIS to your PC with TTL to send commands through the serial port to obtain relevant data packets. 314 314 315 - === (% id="cke_bm_3839S"style="display:none"%)(%%)3.1.1 Themagedateareobtainedbyserialport===315 +Assume the DLOS8 is already set to connect to [[TTN V3 network >>url:https://eu1.cloud.thethings.network/]]. We need to add the AIS Sensor device in TTN V3 portal. 316 316 317 -S electthecorrespondingbaudrate andserialportnumberthroughtheserial port tool, selectHEXdisplayand HEXsend,and continuously receive datafromtheAIS Sensor317 +**Step 1**: Create a device in TTN V3 with the OTAA keys from AIS Sensor. 318 318 319 - [[image:1714985699187-406.png||height="277"width="536"]]319 +Each AIS Sensor is shipped with a sticker with the default DEV EUI as below: 320 320 321 - In the serial port to send data C05A00 00 00 00 04, and then send C0A00 00 00 00 09, AIS Sensor will send a real-time image of the datapacket, and then stop sending. Startwith FFD8 andputit in TXT file321 +[[image:image-20240430155056-2.png||height="207" width="450"]] 322 322 323 - [[image:1714985711524-251.png||height="140"width="526"]]323 +Enter these keys in the LoRaWAN Server portal. Below is TTN V3 screen shot: 324 324 325 +Add APP EUI in the application. 325 325 326 - ===3.1.2 Combinedimage===327 +choose to create the device manually. 327 327 328 - Once all thedata has been uploadedtotheTTN platform, the subsequent step involves concatenating each packet in sequential orderandsaving it into a new TXT file.Itis important to note that the first 8 bytes of each packet should be removed before concatenation.329 +Add APP KEY and DEV EUI 329 329 330 - When you combineall thepackets, you need to convert the datainside to binary. Here the conversion is demonstrated usingthe[[WinHex>>http://www.x-ways.net/winhex/index-m.html]]software.331 +[[image:image-20240430155117-3.png||height="544" width="563"]] 331 331 332 - Open WinHex to openthecombined image datafile.333 +[[image:image-20240430154736-1.png||height="414" width="658"]] 333 333 334 -[[image:1714467040612-103.png||height="134" width="649"]] 335 335 336 - Click ontheeditoption to choose andconvert.336 +**Default mode OTAA** 337 337 338 -[[image: 1714467065723-178.png||height="349" width="762"]]338 +[[image:image-20240430155302-4.png||height="630" width="453"]] 339 339 340 -C hoose theHexASCII->Binaryoption andthenclickOK.340 +**Step 2**: Use ACT button to activate LHT52 and it will auto join to the TTN V3 network. After join success, it will start to upload sensor data to TTN V3 and user can see in the panel. 341 341 342 - [[image:1714467089355-837.png||height="366"width="336"]]342 +=== 3.1.1 Uplink Payload (Fport~=5) === 343 343 344 - After theconversionisfinished,clickon"File"and choose"SaveAs".344 +The uplink payload includes totally 14 bytes. Uplink packets use FPORT=5 and (% style="color:#4472c4" %)**every 20 minutes**(%%) send one uplink by default. 345 345 346 -[[image:1714467112365-676.png]] 346 +(% border="1" cellspacing="4" style="background-color:#f2f2f2; width:370px" %) 347 +|=(% style="width: 60px;background-color:#4F81BD;color:white" %)**Size(bytes)(% style="display:none" %) (%%)**|=(% style="width: 60px;background-color:#4F81BD;color:white" %)2|=(% style="width: 80px;background-color:#4F81BD;color:white" %)4|=(% style="width: 80px;background-color:#4F81BD;color:white" %)4|=(% style="width: 60px;background-color:#4F81BD;color:white" %)4 348 +|(% style="width:99px" %)Value|(% style="width:62px" %)BAT|sysTimeCurrent|Integer|Decimal 347 347 348 - Saveas a.jpgfileand click OK togeneratea JPG file.350 +[[image:1714374026505-898.png||height="200" width="736"]] 349 349 350 - [[image:1714467126476-110.png]]352 +Payload Example(FPort=5):(% style="background-color:yellow" %)**0D 32 66 29 AF E0 00 00 00 02 00 05 E3 B0** 351 351 352 - OpenthesavedJPG file to displaythe imagetransmitted bythe AIS Sensorhrough the serial port.354 +=== 3.1.2 BAT- Battery information === 353 353 354 - [[image:1714467134950-189.png]]356 +These two bytes of BAT include the battery state and the actual voltage. 355 355 356 - =====358 +**Ex**:0x0B32 = 3378mV 357 357 360 +=== 3.1.3 sysTimeCurrent === 358 358 359 -= = 362 +These four bytes contain the year, month, day, hour, minute, and second of the time. 363 + 364 +AI Sensor use Unix TimeStamp format based on 365 + 366 +[[image:1714374373681-339.png||height="81" width="527"]] 367 + 368 +Users can get this time from the link: [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] : 369 + 370 +Below is the converter example 371 + 372 +**Ex**:6629AFE0=2024-04-25 01:20:32 373 + 374 +[[image:1714374389825-148.png||height="313" width="428"]][[image:1714374398047-940.png||height="214" width="508"]] 375 + 376 +So, we can use AT+TIMESTAMP=1714012723 or downlink 6629C233 to set the current time 2024 – April ~-~- 25 Thursday 02:38:41 377 + 378 +=== 3.1.4 Integer === 379 + 380 +These four bytes display the integers in the digital wheel face 381 + 382 +[[image:1714374445395-196.png]] 383 + 384 +Read table integer:0x00000002=2 385 + 386 +=== 3.1.5 Decimal === 387 + 388 +These four bytes display decimals on the digital wheel. 389 + 390 +[[image:1714374493101-914.png]] 391 + 392 +Read table decimals:0x005E3B0/1000000= 0.385968 393 + 394 + 395 +== (% title="Click and drag to resize" %)3.2 Get Image and show in PC(%%) == 396 + 397 +To get the AIS current image on the PC, you can issue commands through TTN or connect AIS to your PC with TTL to send commands through the serial port to obtain relevant data packets. 398 + 399 +=== 3.2.1 The image packets are obtained by TTN === 400 + 401 +Make sure that node ACK is on: AT+PNACKMD=1 or 34 01 402 + 403 +Then send the graph instruction 0B 01. 404 + 405 +The next time the AIS Sensor device runs at the set time, it will start collecting image data. 406 + 407 +[[image:1714465192126-772.png||height="478" width="678"]] 408 + 409 +The uplink payload includes totally 208 bytes. Uplink packets use FPORT=3 410 + 411 +(% border="1" cellspacing="4" style="background-color:#f2f2f2; width:370px" %) 412 +|=(% style="width: 60px;background-color:#4F81BD;color:white" %)**Size(bytes)(% style="display:none" %) (%%)**|=(% style="width: 60px;background-color:#4F81BD;color:white" %)4|=(% style="width: 80px;background-color:#4F81BD;color:white" %)2|=(% style="width: 80px;background-color:#4F81BD;color:white" %)1|=(% style="width: 60px;background-color:#4F81BD;color:white" %)1|=(% style="width: 80px;background-color:#4F81BD;color:white" %)200 413 +|(% style="width:99px" %)Value|(% style="width:62px" %)sysTimeCurrent|BAT|total_packages|subcontracting_count|Image_date 414 + 415 +[[image:1714465532892-179.png||height="250" width="586"]] 416 + 417 +Example of the first payload(FPort=3):663095C00BBE1000FFD8FFE000104A46494600010101004800480000FFDB0043001B12141714111B1716171E1C1B2028422B28252528513A3D3042605565645F555D5B6A7899816A7190735B5D85B586909EA3ABADAB6780BCC9BAA6C799A8ABA4FFDB0043011C1E1E2823284E2B2B4EA46E5D6EA4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4FFC0000B0800F0014001012200FFC4001F00000105010101010101000000000000000001020304050607 418 + 419 +==== 3.2.1.1sysTimeCurrent ==== 420 + 421 +These four bytes contain the year, month, day, hour, minute, and second of the time. 422 + 423 +AI Sensor use Unix TimeStamp format based on. 424 + 425 +[[image:1714465658414-905.png||height="85" width="553"]] 426 + 427 +Users can get this time from the link: [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] : 428 + 429 +Below is the converter example 430 + 431 +EX: 663095C0=2024-04-30 06:54:57. 432 + 433 +[[image:image-20240430162820-5.png||height="218" width="532"]] 434 + 435 +==== 3.2.1.2 BAT- Battery information ==== 436 + 437 +These two bytes of BAT include the battery state and the actual voltage. 438 + 439 +[[image:image-20240430163600-8.png||height="50" width="1141"]] 440 + 441 +**Ex**:0X0BBE= 3006 mv 442 + 443 +==== ==== 444 + 445 +==== 3.2.1.3 total_packages ==== 446 + 447 +This byte represents the total number of packets for the image fetched this time. 448 + 449 +[[image:image-20240430163626-9.png||height="47" width="1116"]] 450 + 451 +==== ==== 452 + 453 +==== 3.2.1.4 subcontracting_count ==== 454 + 455 +This byte represents the data number of the image packet retrieved 456 + 457 +[[image:image-20240430163738-10.png||height="44" width="1117"]] 458 + 459 + 460 +==== 3.2.1.5 Image_date ==== 461 + 462 +Apart from the eight bytes mentioned above, the next 200 bytes are all image data. 463 + 464 +Example the first packet:663095C00BBE1000FFD8FFE000104A46494600010101004800480000FFDB0043001B12141714111B1716171E1C1B2028422B28252528513A3D3042605565645F555D5B6A7899816A7190735B5D85B586909EA3ABADAB6780BCC9BAA6C799A8ABA4FFDB0043011C1E1E2823284E2B2B4EA46E5D6EA4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4FFC0000B0800F0014001012200FFC4001F00000105010101010101000000000000000001020304050607 465 + 466 +Image_date=FFD8FFE000104A46494600010101004800480000FFDB0043001B12141714111B1716171E1C1B2028422B28252528513A3D3042605565645F555D5B6A7899816A7190735B5D85B586909EA3ABADAB6780BCC9BAA6C799A8ABA4FFDB0043011C1E1E2823284E2B2B4EA46E5D6EA4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4FFC0000B0800F0014001012200FFC4001F00000105010101010101000000000000000001020304050607 467 + 468 + 469 +==== 3.2.1.6 Combined image ==== 470 + 471 +Once all the data has been uploaded to the TTN platform, the subsequent step involves concatenating each packet in sequential order and saving it into a new TXT file. It is important to note that the first 8 bytes of each packet should be removed before concatenation. 472 + 473 +When you combine all the packets, you need to convert the data inside to binary. Here the conversion is demonstrated using the [[WinHex>>http://www.x-ways.net/winhex/index-m.html]] software. 474 + 475 + 476 + 477 + 478 +
- 1714985699187-406.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.karry - Size
-
... ... @@ -1,1 +1,0 @@ 1 -84.5 KB - Content
- 1714985711524-251.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.karry - Size
-
... ... @@ -1,1 +1,0 @@ 1 -204.6 KB - Content
- image-20240430165602-11.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.karry - Size
-
... ... @@ -1,1 +1,0 @@ 1 -271.0 KB - Content
- image-20240430165602-12.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.karry - Size
-
... ... @@ -1,1 +1,0 @@ 1 -236.4 KB - Content