Hi, I’m trying to send data to Cayenne from an Android device, that can be picked up by a 8266, and control its behavior. I’ve been trying the REST API command,
It works, but the number is always wrong. I’ve tried lots of combinations of form-data, application/json; charset=utf-8, X-API stuff mentioned on other posts, and it is either rejected, or it replies with a “success” but the data is not there anywhere, and when it does work the data is always a 4-5 digit integer, and never correct. Here are some screens, showing what I am sending, and what arrives. I send 3.14, it arrives at channel 99 on the correct device, but the number is 18266! Any advice?
MQTT API which runs in the micro-controller (pi, 8266, etc) and sends data to the Cayenne Server. This uses the computer generated name/password like 971da7b0-fd21-11e6-ac86-a9a56e70acce and 257f5a90db0155038259970431cxxxxxxxxxx194 which are written in the eprom of the controller.
Cayenne API which runs on the user’s computer, webpage, phone, etc and 1. fetchs data from the Cayenne Server, and 2. sends commands to Cayenne Server to create devices, jobs, etc, and 3. sends commands to Cayenne, which are forwarded down to the micro-controller to turn on leds, motors, etc. This uses human control like MrPeanut@gmail.com and peanutpassword, and the oAuth2 authentication derived from those human name/password.
I’m trying to use Cayenne API to tell my wine controller 8266 that it should stop running the First Fermentation Program, and switch to Second Fermentation Porgram, without unplugging it and re-writting a new program into the eprom.
Sending a command to a mqtt channel through HTTP api
POST /v1.1/things/{thingsId}/cmd
I can get his working – that is the authenication and json formats are fine, but the data that arrives is wrong. Many posts on the community having the same problem weeks and years ago. No one seems to have posted a solution. (see post 2)
The idea of using the MQTT API seems in-elegant as I already have the oAuth2 authentication on my Android, but now I’m pretending to be a microcontroller and sending MQTT commands, with those big name/password and Basic authentication with base64 etc, but I gave it a try and cannot get that working either. (see post 3)
So, is there a document or a post, or a human available. If there is a solution, I promise to write it up for the next guy.
Here is the attempt with the Cayenne API technique sending to platform.mydevices.com. This box contains 4 attempts to send 0, 1, 2, 3, and 3.14 and Cayenne gets the numbers 24719, 66656, etc. So, not a success.
I had the same problem with random values, but when I had the device disconnected, I mean if I have a device connected to the dashboard and it is sending data to a widget, I can “send” data to that widget via API correctly, I can modify it’s value. I don’t know if I have explained it well…