Part 4: How to publish the application

In part 4, the next steps after the initial development of the application are described here.

Make it portable

Currently the packet is not actually portable, as it requires a power source which is established by a USB connection to the computer.

Firstly, to ensure portability can be achieved an independent power source is required, such as a battery that can provide the Raspberry Pi with adequate power to enable the packet to be tracked.

Secondly, it is necessary for the tracking script to be automatically enabled after the the Raspberry Pi boot process has been executed.

This can easily be achieved on the Raspberry Pi by installing pm2 globally as shown below:

npm install pm2 -g
pm2 startup

This should print the applicable command in the terminal window. Copy it and paste it in the terminal again to complete the setup of the pm2 startup script.

Start the tracking script with pm2.

Run the following command inside the light_alarm folder on the Raspberry Pi as shown below:
pm2 start --name lightAlarm index.js
Add the tracking script to the list of processes, that will be started automatically when the Raspberry Pi is started as shown below:
pm2 save

After this has been performed, log out from the Raspberry Pi, disconnect it from the computer and connect it to an external portable power source. After the boot process has finished (approximately 1-2 minutes), then the tracking script will start running, which in turn will check the light sensor every second.

Further improvements

Connect more sensors to secure the travel of the packet. For example, implement a TemperatureAlarm or HumidityAlarm to the LightAlarm transaction type.

Alternatively, allow the network to know the current location of the packet by transmitting the GPS location within a certain time interval.