Trigger an n2k switch via a url?

Is there any way to trigger a switch via a url? I have terminal only access to the n2k server as I shut my router down by accident. Is there a way I can send PGN 126208? By hitting a SignalK url or the likes?
10 Replies
Scott Bender
Scott Bender6d ago
So you can’t bring up the sk admin console?
SeaSquatch
SeaSquatchOP6d ago
I am getting in via peplink in touch on another router that is connecting into the WiFi. For whatever reason the admin console doesn’t render too well and the data browser is blank. I tried via chrome, still no great control panel, but I do get the data fiddler to show up, but not sure if it’s functional.
Scott Bender
Scott Bender6d ago
You can send a PUT request or n2k via Data Fidler You can also send a PUT from the command line curl -X PUT \ http://localhost:3000/signalk/v1/api/vessels/self/steering/autopilot/targetHeadingMagnetic \ -H "Content-Type: application/json" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -d '{ "value": 1.5708 }' value would be 1 for a switch
Scott Bender
Scott Bender6d ago
(That of course assumes you have n2k switching plugin on and working)
SeaSquatch
SeaSquatchOP6d ago
Scott Bender
Scott Bender6d ago
Yes, but add /state
SeaSquatch
SeaSquatchOP6d ago
"PUT not supported for electrical.switches.bank.11.4.state” 😦
Scott Bender
Scott Bender6d ago
Would happen when the n2k switching plugin is not running
SeaSquatch
SeaSquatchOP6d ago
I’ll have to take a look at that when I drive out since that sounds like the path now 🙂

Did you find this page helpful?