Node-RED with PIC Microcontroller

I am new to Node-RED and today first time created account and logged. I want to control a device over WhatsApp. The device has PIC microcontroller. I need tutorial and guidance.

Wow, where to start. Let's see, what is the device? What does it do? What do you want to make it do? What have you tried? Is it even possible to control it with what's app? What part does node red play in this? Is there a better place to get the information you want? Most here are glad to help but won't do your work for you. You are going to need to do the heavy lifting.if you are going to use node red have you read all the node red tutorials?

Hi gerry, I answer all your queries. What is device: A PIC microcontroller based device connected to GSM network. At present, it is possible to turn on/off using SMS. Now, I want to do same with WhatsApp over Node-RED. It means, from mobile, the message will be send to to device (through Node-Red). I am myself embedded software developer.
In the flow chart, the Node-RED need to transfer the message between device and WhatsApp.

To create Node-RED project, is it required to install or may be run online ?

You have not given much extra information there, but maybe you did not know what info is relevant.

Does this microcontroller have mobile data or just phone (ie can only use SMS)?
Do you control the device programming?
Can it read/send Whatsapp, or is the Whatsapp solely between phone and Node-red?
What messaging protocol do you envisage between Node-red and the device?
Does the device send data or only receive on/off commands?
If the device is off, how does an SMS turn it on?
Can the device use MQTT?

Why did you choose Whatsapp? It might be possible but MQTT would be more elegant if it's available.

You can setup Node-red on an Oracle Cloud Free Tier. It's not very easy to do.
Probably the easiest way to setup Node-red is on a small Linux device such as a Raspberry Pi.
It can also be installed on a PC or, possibly interesting for your use case, on an Android phone

Is your question not about the controller, but how to send messages to WhatsApp? If so then I suggest searching the node-red flows site for WhatsApp. Perhaps one of the hits there will be useful to you.

The present device can be turned ON/OFF and other operations by SMS through GSM network. We ourselves develop the firmware. So, now we will develop firmware for ON/OFF through Data over GSM network by sending messages from WhatsApp in a Mobile. The user will send ON/OFF message from WhatsApp to device. Let the mobile number of user is 12345 and user mobile has WhatsApp. Device also has a SIM (let, number 54321). It is required to send messages using WhatsApp both way. The device does not have WhatsApp, but it can send data over TCP using HTTP or MQTT to a given URL or API link. So, may node-red be used to make such an application ? What the Broker / Server recommended for use in India ?

It still is not clear what node-red needs to do. Please explain exactly what that is from the point of view of node-red.

There's no easy way to get at WhatsApp messages.

WhatsApp actively fight any method of doing so

This is not a viable project in it's current suggested form

1 Like

Finally someone said it :+1:

@mexcoindia I would concentrate on getting your device firmware reliably & securely connecting to an MQTT broker & switching on/off via simple MQTT topic and payload.

Once you have this then you can use node-red to provide http endpoint or telegram or MQTT or TCP/UDP or whatever you can imagine, to map through to the device.

Hi Everyone, I need application like in this link:
Control ESP8266 from Whatsapp using Node-RED and MQTT Communication - YouTube.
suggest further. In this, I do not how to set properties of Inject and other Nodes ? I am trying to create first application using Node-red flow. How to set MQTT Node and WhatsApp node ? I shall write function code in JS myself. May any other language like JAVAFX be used in place of JS ?
In this link, Arduino has been used, but I shall use PIC microcontroller and corresponding IDE for embedded firmware for device to access HTTP or MQTT over TCP.

in this video, VPS Yaser has been used server. Do I need to create account some where on any MQTT broker etc ? What are low cost servers in India for low data communication ?

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Also, for to learn about mqtt then see this tutorial MQTT Essentials - All Core Concepts explained

The system diagram from that youtube video looks like this

I think it's useful because it illustrates the fact that communication between microcontroller and Node-red has nothing to do with Whatsapp.

A microcontroller with sensors and relays, MQTT and Node-red is a very common arrangement and I am sure you can find lots of examples in the forum or

This arrangement does not depend on the microcontroller firmware. I have seen it working with the Arduino IDE, Tasmota and Micropython.

So in your investigation of Node-red concentrate first on the PIC / MQTT / Node-red portion.

Once that's working you can consider communication with the phone[s]. People have hinted that WhatsApp may not be the easiest solution, but maybe that decision is set in stone.
It ought to be possible in Node-red, and it's trivial to connect the two subsystems in your NR flow.

There are cloud based MQTT brokers which offer a free tier for low data volumes. eg HiveMQ free broker allows 100 devices and up to 10GB data.

Thanks JBUDD for detailed guidance. I have on more question. I plan :-

  1. Write code to connect microcontroller (mcu) to MQTT, then, need to do all TLS , JSON/ MQTT packet serialization/ deserialization inside mcu.
  2. Program MQTT / WhatsApp chat related node-red compiled code in esp8266. The message received from broker are first captured by ESP8266 and sent over serial port to mcu. Similarly, messages from mcu are sent to broker by esP8266. So, ESP8266 will be intermediate and Node-red code will reside here.
    which option, should I go for ?

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