Need help with sending data


#1

I’ve got an MKR GSM 1400 board configured to receive data via a TCP socket on port 4010. I can use the dashboard to send data successfully. However, when I try use the API, it fails. I try to send:

curl --verbose POST \
--header "Content-Type: application/json" \
--data '{"deviceids": ["device_id"],"protocol": "TCP","port": 4010,"data": "Hello world!"}' \
https://dashboard.hologram.io/api/1/devices/messages?apikey="api_key"

…using my device_id and api_key respectively. I get back the following response:

{"success":false,"error":"Not all devices have cellular links"}

And no data is received via the socket. Any clue as to what I’m doing wrong?


#2

Not sure why the above example didn’t work, but I was able to send data to a socket by creating an inbound webhook:

curl --verbose POST \
--header "Content-Type: application/json" \
--data '{"deviceids": ["<device_id>"],"protocol": "TCP","port": 4010,"data": "Hello world!"}' \
https://dashboard.hologram.io/api/1/devices/messages/201825/<reserved>

closed #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.