Using NoteCarrier F, NoteCard WBNAW, STM32 Swan, Arduino IDE.
Attempting to publish a command to another NoteCard using a MQTT cloud to turn on a BUILTIN_LED on the Client receive notecard.
Receive notecard seems to be working because if I add a note.qi to the notecard via notehub the LED will turn on and off. The “on” note.qi = {“command”:“on”}, “off” note.qi = {“command”:“off”}.
The transmit notecard sends the “on” command every 2 minutes, and in notehub events the green “status” icon turns on for the “note.qo”.
I am seeing both notecards in my cloud LOG, but the LED will not come on.
What am I doing wrong???
Thanks
Hi @DonL,
The onboard LED of the Notecards are not directly controllable. They generally light when the Notecard is transmitting data or reading/writing to/from flash memory. If the program is working as expected, that’s a good thing!
Rob
Sorry Rob, I meant to say the BuiltinLED on the SWAN. And yes the receive program does turn the SWAN LED on and off at the beginning of the program just to make sure it is working.
Plus I forgot to mention that the “on” command {“command”:"on} is showing up on my iPhone (also a client) every 2 minutes. Hopefully this means that the transmit board is sending the “note.qo” from notehub to my MQTT broker, then to my iPhone. Still the LED on the receive board SWAN does not turn on. Thanks
I now believe the transmit board is working correctly, but the receive board is not sending a publish to connect to the MQTT cloud. The receive board does show up on the MQTT cloud log, but does not show a device ID, and it shows subscribe 7 times. (Screenshot #375)
Is there a simple addition to the receive program to force a publish???
Receive program:
Hi @DonL,
Are you seeing the note.qi
show up in Notehub (the event you are publishing from your MQTT server)? If you can manually create a note.qi
Note in Notehub and the “receive” Notecard is processing it correctly, I’m guessing there is a problem with your MQTT server publishing an event with the Notehub API?
Rob
I agree that the issue may be with the MQTT server, although the published events seem to be showing up in the MQTT server logs.
Something I noticed, I can see the published note {“command”:“on”} using MQTTX if the published note is sent from my iPhone, and/or the “transmit” notecard.
But if I delete the password in MQTTX, the server will not connect. This may an issue because in my notehub ROUTE “cloudmqtt” setup it does not allow me to enter a password. I type in the password, hit APPLY CHANGES and CONFIRM and it seems to allow the changes, BUT when I go back to the “cloudmqtt” route the password is “OMITTED”.
Is this normal, why won’t the “cloudmqtt” route keep the password???
Hi @DonL,
The password is being saved, but you’ll see OMITTED
in the Notehub route as we can’t securely populate that form field with the existing password. Also, just to be clear, Notehub routes only function in one way (FROM Notehub TO your external server). If you want to create an inbound Note in your project, you have to use the Notehub API and use curl requests, for example:
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/<note>'
-H 'Authorization: Bearer <access_token>'
-d '{"body": {"temp": 72.22 }}'
I apologize for my lack of understanding concerning all of this, as I am not an IT guy. Earlier you stated that “Notehub routes only function in one way (FROM Notehub TO your external server)”.
I understood that with a MQTT route, Client 1 could send data to Client 2 through the broker (cloud) if both Clients used the same Topic. I now know there is more to this without using a 3rd party dashboard or app. (Have not found a MQTT program for Blues)
Just curious:
Can the API curl commands (Exp: note.qi) be sent by a swan or could I use something like an arduino uno or Raspberry pi (if this is even possible)? (bearer tokens expire)
Our systems have to be fully automated without human intervention.
Thanks
No need to apologize, we’ve all been there! I understand the source of your confusion too. Unfortunately those Notehub API commands (the curl requests) have to be made from a server or any computer frankly, but they can’t be made from the Swan (or generally any other microcontroller).
WoW, Instant response, Thanks !! Guess I was confused after seeing: