Serial Port Do not return data

174 views
Skip to first unread message

Nhan Le Duy

unread,
Jun 12, 2021, 10:11:54 PM6/12/21
to RedMobile
Hi,
I have just use redmobile for my project to collect data from USB-Serial.
My problem is Serail-Read do not return data.
Please look at the photo attatchment.

The project be describled as below

1. Arduino as modbus slave
2. Red send payload in hex string for get 5 holding register
3. Arduino return hex tring as modbus response(had seen the data respond by Led on Arduino RX,TX)

Red do not return data.

Please support me to fix it.
(Redmobile Serial return data only if we send and receive normal text string)


 

image (3).png

okhiroyuki

unread,
Jun 12, 2021, 11:30:12 PM6/12/21
to RedMobile
Hi, 

It is not possible to read what kind of code is described in the image, but please try it first with a simple code.
Also, RedMobile can only handle either String or Hex-Strings.

Attached is a sample of turning an Arduino LED on and off using Hex-Strings.

スクリーンショット 2021-06-13 12.28.39.png


sample.zip

Nhan Le Duy

unread,
Jun 13, 2021, 8:27:36 AM6/13/21
to RedMobile
Hi,

Thank you very much for your code. But my problem is ReMobile do not return data when Arduino send binary data over serial. Please try the code as below

#define LED 13

uint8_t rsp[5]={1,2,3,4,5};

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    uint8_t i = (uint8_t)Serial.read();
    if(i == 0x41){
        digitalWrite(LED, LOW);      
    }else if(i == 0x42){
        digitalWrite(LED, HIGH);      
    }
    Serial.write(rsp,5);  //This is the data want to RedMobile to return for processing. The println(i) will return data in ASCII code with ending \r\n->So that i call it is a text string

okhiroyuki

unread,
Jun 13, 2021, 9:18:02 AM6/13/21
to RedMobile
Hi, 

I'll check your code when I have time.

2021年6月13日日曜日 21:27:36 UTC+9 nhan...@gmail.com:

Nhan Le Duy

unread,
Jun 13, 2021, 10:13:56 AM6/13/21
to RedMobile
Hi Hiroyuki Okada,
I discover that the Remobile will return data when it receive character \r (0x0D). So that it can not handle binary string. Please change your algorithm to solve this.
My suggestion is the receiver module (Serial Read) with more option to return data for example "After time out ...",  "After silent of xxx ms"  or refer to this app for more detail

Please take more time to fix the app.

Nhan Le Duy

unread,
Jun 13, 2021, 8:59:46 PM6/13/21
to RedMobile
Hi Hiroyuki,

I found this option in the serial receive module in Node-Red(photo attachment), Could you please integrate it to RedMobile Please?


Node-Red Serial Option.png

okhiroyuki

unread,
Jun 14, 2021, 9:15:23 AM6/14/21
to RedMobile
Hi

>I found this option in the serial receive module in Node-Red(photo attachment), Could you please integrate it to RedMobile Please?

Please share the URL of the node.


2021年6月14日月曜日 9:59:46 UTC+9 nhan...@gmail.com:

Nhan Le Duy

unread,
Jun 14, 2021, 10:06:51 AM6/14/21
to RedMobile
Hi,

The module running on raspberry pi node-red. I install it from this url https://flows.nodered.org/node/node-red-node-serialport

Nhan Le Duy

unread,
Jun 17, 2021, 3:47:08 AM6/17/21
to RedMobile
Hi Hiroyuki,

My project is coming to the deadline day. Could you please fix the serial module please?

okhiroyuki

unread,
Jun 19, 2021, 7:56:45 PM6/19/21
to RedMobile
Serial communication has something to do with Android libraries and is not something that can be easily fixed.

You can add Modbus and other nodes of your choice by referring to the following.

I have made that point in a previous email.

> You can add Modbus and other nodes of your choice by referring to the following. However, RTU is probably not possible.

2021年6月17日木曜日 16:47:08 UTC+9 nhan...@gmail.com:

Nhan Le Duy

unread,
Oct 5, 2021, 11:13:27 PM10/5/21
to RedMobile
Hi Okhiroyuki

Have you fixed the Serial packet process without CR character?

Message has been deleted

Nhan Le Duy

unread,
Sep 4, 2022, 5:46:11 AM9/4/22
to asad khan, RedMobile
Hi Friend,

Don't waste your time with the serial module anymore. The new update redmobile has made this module completely fail to receive even data packets ending with a carriage return.
I've reported to the develop team many time but they do not solve the problem.

On Thu, Sep 1, 2022 at 8:56 PM asad khan <asad.kh...@gmail.com> wrote:
Hy i am using and RFD868 RF modem which receives serial data via another RFD868 modem. The modem is connected to my tablet via a FT232 cable. I am using serial read module to read the serial data that i am receiving on RFD module but its not working. Could you please tell what could be the reason? is  FTDI is not supported by serialread node
--
You received this message because you are subscribed to a topic in the Google Groups "RedMobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redmobile-apps/T_knoqyzuNw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redmobile-app...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redmobile-apps/623f7913-7ef4-427a-9b6c-2a8cbb14109fn%40googlegroups.com.

asad khan

unread,
Sep 7, 2022, 5:12:26 AM9/7/22
to RedMobile
array.PNG
Hy i am having issue receiving serial data via node-red serial module, I am sending "All 26 English alphabets in one message".  Instead of receiving all the message one by one separately, i am receiving them in one array. The serial port instead of showing real time data of each message in separate array, it makes a big array and store message and be idle, when i stop sending data then it prints a full big array of alphabets. You can see that in the image too. How can i fix that issue?  
Reply all
Reply to author
Forward
0 new messages