This commit is contained in:
Arthur 2024-07-10 17:47:53 -04:00
parent 782d0c4a30
commit dc0dcfe6e8

View file

@ -56,14 +56,16 @@ To flash the base firmware to the Atmel microcontroller, follow these steps:
+ Ensure the selected file is `application.elf` either in the `Debug` or `Debug_V71Q19B` folder.
+ Press `Programm`
#text(fill:red)[Add instructions for reseting the security bits to 0x42]
For later flashing of the firmware, it is also required to set the GPNVM bits to 0x42.
+ In the `Device Programming` tool, select in the left sidebar `GPNVM Bits`.
+ If the value is anything other than 0x42, set the value to 0x42 and click `Program`.
To set the security bits that diable recovery of the firmware, select `Security` in the left sidebar of the `Devide Programming` menu and press `Set`.
To set the security bits that disable recovery of the firmware, select `Security` in the left sidebar of the `Devide Programming` menu and press `Set`.
= Registering Device
The firmware of the box contains the information for the conecting to the server.
To get these information, you first need to register the new box in Palitronica's system.
To get these information, you first need to register the new box in Palitronica system.
The frontend \footnote[https://steetdev001.z27.web.core.windows.net/] lists all boxes across all tenants and can be used for some operations but we will mainly use it to register a new box.
In order to register a new device, you need some information including the `MCU Serial` and the `MAC Address` of the box.
@ -84,13 +86,13 @@ Now in the frontend, follow these steps:
#figure(
grid(
columns: 4,
gutter: 5pt,
gutter: 10pt,
stroke: 1pt + gray,
align: left + horizon,
inset: 0.5em,
[ *`Sensor Id`*\ On the label.], [*`MCU Serial`*\ From the Pi], [*`HW Version`*\ On the label], [*`MCU Model No.`*
[ *`Sensor Id`*\ On the label.], [*`MCU Serial`*\ From the Script], [*`HW Version`*\ On the label], [*`MCU Model No.`*
\ 1.00],
[*`Tenant`*\ Dev2 Lab], [*`Aggregator`*\ `sf-pc48`], [*`MAC address`*\ From the Pi], [*`Chip`*\ Model of the Atmel chip],
[*`Tenant`*\ Dev2 Lab], [*`Aggregator`*\ `sf-pc48`], [*`MAC address`*\ From the Script], [*`Chip`*\ Model of the Atmel chip],
[*`CAN Interface`*\ Likely False], [*`Power Connector`*\ Connectors of the daughter board], [*`Deployement Status`*\ Personal Us],
),
caption: "Information for registering a new device and where to find them."
@ -106,8 +108,41 @@ Once the device is added to the frontend, you can find the connection string in
= Flashing Firmware
To flash the firmware, you first need to update the configuration file that stores the informarion specific to this box and then flash the rebuilt firmware to the box.
+ Update the file in `base-firmware-new\application\src\aa_set_device_parameter_here.h`
+ Change the `SAS_KEY` value to the connection string from the IoT Hub.
+ Change the `AZURE_DEVICE_ID` field to the Id of the box from the label.
+ If needed, change the `MCU_DEVICE_ID` field to the last three characters of the Atmel chip serial.
+ Save the configuration with `ctrl+s`.
+ Rebuild the firmware with `Build` #sym.arrow `Build Solution (F7)`.
+ Verify that the box is properly connected to both power and the Atmel adapter.
+ In `Tools` #sym.arrow `Device Programming` detect the box as for the base firmware.
+ Under `Memories` in the left sidebar, select the file to flash that end with `V71Q19B_`#text(fill:orange)[`XXXX`]`.hex` with #text(fill:orange)[XXXX] a four-characters hexadecimal number.
+ Click `Program`.
Congratulation, the box is all flashed, you are almost done.
= IoT Hub Setup
Now that the box is flashed, power cycle it and connect it to a PoE enabled port that has internet access.
+ In the IoT Hub, under `iothub-eet-dev-001` #sym.arrow `Devices` select the newly flashed box.
+ Access the configuration in `Device Twin` in the top bar.
+ Make sure the field `properties` #sym.arrow `desired` #sym.arrow `enableTransmission` is set to `true`. If not, change it and save the configuration.
+ Access the aggregator configuration in `iothub-eet-dev-001` #sym.arrow `IoT Edge` #sym.arrow `sf-pc48` #sym.arrow `IRF` (bottom section) #sym.arrow `Module Identity Twin` (top bar).
+ In the config, in the `targets` array, add an entry following the same template as the other entries with two fields:
+ `interceptorId` is the Id of the box (printed on the label).
+ `targetId` is the name of the MinIO folder where all the data will be stored. By default, enter the same as the box Id.
+ Save the configuration.
The finale step is to restart the aggregator to apply all the changes.
+ SSH into the `sf-pc48` server.
+ #text(fill:red)[write command]
= Verification
Go on MinIO and verify that a folder with the name of the box was created and that some data started comming in. If not, good luck debugging this mess (I recomend redoing everything...).