Passing a message to a Core from another device

I have another gizmo here that I’d like to use to send a ‘message’ or ‘signal’ to the Core.

Basically when a button is pressed on this OTHER WiFi enabled microcontroller I’d like to somehow get a message to the Core so that I can act on the input.

How best to do this? Is there a Cloud service/feature I can use for this?

Thank you!! :slight_smile:

another gizmo

this, and this:

this OTHER WiFi enabled microcontroller

Is a bit too vague to give a decent answer.

“I’ve got this ‘thing’, and this ‘thing’, how can I make them do nuclear fission and travel through time?”

If you could explain in a bit more detail what you’ve got, and what it’s capable of, we might be able to provide better answers.

4 Likes

Just a view questions to allow a more tailor made answer:

  • Will your two devices be on the same network?
  • What capablities does your other gizmo provide (UDP/TCP/HTTP/node.js/…)?
  • What are your time demands? Does it need to be near realtime or not?

Now I’m going to read @Moors7’s post, that just popped up :wink:

3 Likes

Sorry! :blush:

It’s a teensy with a WiFi module attached.

@scruffr Yes they will be on the same network. It needs to register with the core within about 4s I would say. So human instant as opposed to machine instant.

Thank you. And sorry for being vague.

Depending on the toolset your Teensy (or better the used WiFi module) gives you (library wise) I’d go the UDP/TCP route

http://docs.particle.io/photon/firmware/#communication-tcpserver
http://docs.particle.io/photon/firmware/#communication-tcpclient
http://docs.particle.io/photon/firmware/#communication-udp

Thanks @ScruffR. OK, but is there nothing quicker? No easy way to interface with the Subscribe/Publish mechanism? Thanks again.

@jbennett, did you use publish/subscribe for your walk/don’t walk sign? Or did your webpage communicate with your core via the direct methods scruffr recommends? thanks

I’d consider this (UDP/TCP) the quickest and easiest way, in the over all view.

Sure Spark.subscribe() would be the easiest on the Core’s side, but you’d need more effort on the Teensy side (I guess - without knowing your WiFi library there).

On the other hand UDP/TCP is not that much of an effort do take on the Core, but just as little on the Teensy side (I guess again)

1 Like

@daneboomer, to use the Spark.publish/subscribe() features, your teensy would need to support COAP authentication to the cloud and have the right keys, yada yada yada. The UDP/TCP method doesn’t require all that fuss. It’s probably simpler to replace your teensy with a Photon! :smile:

3 Likes

Hi @Dave, I noticed this post in another thread. This sounds PERFECT for what I’m trying to achieve here?

Yeah, if you have HTTPS support on the teensy then sending a API request via the Cloud REST API would be a quick way forward. But I’m guessing you don’t have HTTPS support there? In which case, using UDP/TCP directly to the device would be the simplest approach to implement.

2 Likes