Using Remote Command and Control

Hello,
I am interested in implementing the the remote command and control tutorial but have a question that may defy the statement, there is no such thing as a stupid question.

I want to send a command from the Notecard to the Swan. This seems reasonably straight-forward. The question I have is how do I get the “command” into the Notehub so that it can be picked up by the Notecard?

I set up Twillio to receive SMS from the Swan as necessary and I am comfortable with environmental variables. I realize this might be a " wow, this guy is really lost" question but am asking anyway. I need an easy method to get the request to the Notehub so it can be directed to the Notecard.
Thank you in advance.

Hey @TJK,

Not a dumb question at all. There are two different different ways get the “command” into Notehub, and they’re probably best spelled out in this section of the documentation: Notehub Walkthrough - Blues Developers.

Option #1) The Notehub UI. You can manually add Notes to a device in the Notehub user interface. This is probably where I’d start because it’s the easiest way to get data into Notehub when you’re initially testing things out. Once the Note is queued in Notehub, your Notecard will receive the Note on its next inbound sync.


Option #2) The Notehub API. The Notehub API allows you to programmatically add your data, and you’ll eventually need to use the API if you plan to build this behavior into something like a dashboard or app.

If you want to go down this path I’d read through this tutorial: Using the Notehub API - Blues Developers. For what you’re trying to do you’ll specifically need to worry about authentication (Using the Notehub API - Blues Developers) and adding Notes (Using the Notehub API - Blues Developers).

Hope that helps. If you need further clarification feel free to reply and we can help you out.

TJ

Thank you for such a fast reply. I actually remember reading that section now that you bring it up.
I assume, since I have a Notecarrier with a Swan and Notecard that I don’t need to do this:
As a first option, you can configure your Notecard to stream data from its AUXRX / AUXTX pins to a host device’s TX / RX pins. This option is the absolute fastest way to receive signals, as signal data gets streamed directly to your host as the Notecard receives it.”

I have one more question regarding VS Code and PlatformIO. It seems that many times if I modify code, recompile it and upload it to the Swan, my most recent changes are ignored. Is there some trick to making sure VS Code recompiles the entire file? I have tried Build but I get a similar result. I have had a fair bit of trouble geting my millis() if statements to be recognized correctly…hence 130 sms in 10 seconds…any advice would be greatly appreciated.
In fact I just tried a “clean” command then a “build” and uploaded the code to the swan and my commented-out code ran.

TJK

I am still wondering why code that is commented out runs after a build. There has been another report of VSC/PIO behaving this way. I would appreciate advice.
Thanks

If anyone experiences a similar problem, the behavior was not a problem with the code but an Intel update that apparently never made it to my machine. I manually installed the update and the compiler started working correctly.

Oh wow, I hadn’t hit that issue on PlatformIO so that’s good to know in case it comes up for anyone else.

And then for this bit.

I assume, since I have a Notecarrier with a Swan and Notecard that I don’t need to do this:
As a first option, you can configure your Notecard to stream data from its AUXRX / AUXTX pins to a host device’s TX / RX pins. This option is the absolute fastest way to receive signals, as signal data gets streamed directly to your host as the Notecard receives it.”

Correct. Just make sure you have the AUX DIP switch on the Notecarrier F set to the DFU position. It should be set to that by default, but good to confirm.

TJ

For troubleshooting on PlatformIo to use the terminal for sending commands, you can do that directly with : https://community.platformio.org/t/is-there-anyway-to-send-manually-typing-messages-to-arduino-through-serial-port-in-platformio/15326/16

regards,
Rob

Thank you @robouden. I had to go directly to the manufacturers website to find the necessary updates. Windows was reporting that everything was current. Apparently not.

Thank you @tjvantoll. Got it.
Tom

Never trust manufacturers and software. :slight_smile:

Regards,
Rob

Oh, I trust them. I trust them to do exactly what they do/did.

1 Like