Troubleshooting Communication Problems with the Pi Hat

We have noticed that in some occasions, specially with the Raspberry Pi 4 being powered from the Pi Hat, it is possible that due to current fluctuations, the Pi Hat loses power and stops responding to the Payment master daemon. For that reason, it has been decided to add a feature that could log these issues to the logfile, and also allow NodeRED users to see if this issue occurred.

It is important to note that this information is disclaimed by Qibixx, stating that its Power Supply capabilities can deliver up to 3A, which is enough for most of the Pi Models, but may be on the fringe for Raspberry Pi 4.

To enable this functionality, it is first necessary to enable the watchdog feature on Payment Master Daemon by editing the startup.sh script and adding "device-watchdog=true".

Bash
Copy

Now, in case there is an issue with the communication, the errors will be shown in the log file (if "debug=true").

Error Example
Copy

** **

Catching the error in NodeRED

In case there is also the need to log the issue on NodeRED, it is necessary to take the following steps:

1 - Add a debug output to Payment Master Daemon, needs to be on the bottom output (label msg on picture below)

2 - Change the configuration of this debug output to "Complete msg object".

** **

3 - Click done and reload deploy the flow. Now, when the issue occurs, the debug console will show an error like displayed below.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard