Configure events with CNCJS
In this article I’ll quickly show how to configure 2 events to send push notifications to my Iphone.
Requirements
- A pushover account.
- The application installed and licensied on your phone.
- cncjs installed, configured and has access to internet.
Steps
In cncjs webui you can navigate to
- settings > Events
- and click Add
Create a new application in pushover
How to retrieve your user key ? Simply connect to your account in the web browser and you should get it there.
How to create an app ? On the same page at the bottom, you can click on create an Application/API Token or this URL : https://pushover.net/apps/build
How to use different sounds ? The existing sounds are availbale here : https://pushover.net/api#sounds There is also a new feature to upload custom sounds !
You can also change the message priority ! The documentation is available here : https://pushover.net/api#priority
First event
I want to know when the job is done,
Select the G-code: Stop event with the system as the trigger. The command is this one:
curl -s \
--form-string "token=REPLACE_TOKEN" \
--form-string "user=REPLACE_USER" \
--form-string "message=CNC Job Done" \
--form-string "priority=1" \
--form-string "sound=bike" \
--form-string "url=http://192.168.2.43:8000/" \
https://api.pushover.net/1/messages.json
- Replace the token and user keys with the one provided by pushover
- The url field can be removed or replaced by your cncjs webui url
Second event
I want to get notified if the cnc is paused
Select the G-code: Stop event with the system as the trigger. The command is this one:
curl -s \
--form-string "token=REPLACE_TOKEN" \
--form-string "user=REPLACE_USER" \
--form-string "message=CNC Job paused" \
--form-string "priority=1" \
--form-string "sound=falling" \
--form-string "url=http://192.168.2.43:8000/" \
https://api.pushover.net/1/messages.json
- Replace the token and user keys with the one provided by pushover
- The url field can be removed or replaced by your cncjs webui url