When Quasar is running in production, we assume the printer(s)/LED sign is at a certain IP address and forward requests to it, no questions asked. This risks having a request be forwarded to a non existent device and then the SQS message deleted meaning we cannot recover the failed request.
The ping command can be used to check if a device is up at a certain IP address. To run the ping command from Node, we can use exec. An example is below:
pinging the printer should happen before Quasar replies to Clark from the print request. if the printer is down, return 500 to Clark.
game plan
[ ] learn basic fastapi
[ ] learn how to send a icmp packet to the printer with python
[ ] make the logic to ping the printer only happen if a value in the config file for Quasar is set to true
game plan (clark)
[ ] if the printer was unresponsive, on Clark we should surface this error to the user. this means the error from the Quasar API needs to be returned from the Clark API to the frontend as well
When Quasar is running in production, we assume the printer(s)/LED sign is at a certain IP address and forward requests to it, no questions asked. This risks having a request be forwarded to a non existent device and then the SQS message deleted meaning we cannot recover the failed request.
The
ping
command can be used to check if a device is up at a certain IP address. To run theping
command from Node, we can use exec. An example is below:If you're unfamiliar with
ping
, check out this animated YouTube video.Some things to consider
ping
normally "pings" an IP address until stopped. how do we specify only a limited number of packets?Ideal workflow
exec
to ping a device