SerialDirect to forward null

I have an arduino connected to the uart of the pi. Then sending data as

<nodeid> <data1> <data2> etc...

I am using SerialDirect from emonhub to post data with http.
I read on this thread below that we can post ‘null’ values which act as if nothing is send on that channel. This is a feature I am interested in.
https://openenergymonitor.org/forum-archive/node/11637.html

So on my serial string I tried sending ‘null’ hoping this would be translated and posted as is. However the SerialDirect just ignore the string stating it contains some non-numerical content.

Would you know a way to post null on a channel when using SerialDirect?

A belated welcome, Damian.

I’m sorry no-one has picked up your question, I can’t answer it, but it’s possible that @pb66 will be able to help.

1 Like

Thank you. I hope someone will answer.

Where are you posting it to? Local install or emoncms.org as that thread does say it does not work to the latter.

[edit] Just tested locally and a value (unquoted) of null is ignored.

WHY do you want to send null values? Are you trying to send bulk uploads as the post you linked describes? More detail on your goal will be useful to understand your problem. I send a lot of data to emoncms.org and to my local emonPi from an Arduino connected to a Pi, so I might be able to help.

Thanks Brian and Steve.

Brian. Local or remote does not matter. In both cases the issue is the same. Yes null gets ignored when forwarded. This is what we like. Now try and send a null on the uart and get SerialDirect to receive it. There Emonhub complains about non-numerical data.

Steve. My goal is to send a row of data where one of them can be null. This way all channels can updates except the null one.

What I want to do is easy to understand. You have say 3 sensors. Then sensor2 for some reason is absent or in error (out of range etc…). I would still want to update sensor1 and sensor3. So the serial string will be
null

But the problem is that currently Emonhub complains about the non-numerical value (null) instead of forwarding the null on the http request.

The problem is that SerialDirect does not treat the null where it would be nice to have it to forwarding the null.

Ah, I’d missed that bit of the puzzle.

Can you post the relevant Emonhub logs with loglevel set to debug please. Plus the related output from the Arduino.

I’ll try and help but it’s not and area I am overly familiar with.