Node-Red on android phone advise


Hi All,
If anyone has a play with the termux api, would appreciate some advise on NR on android platform. Installed NR on android phone and pleasantly surprised at how fast and easy the installation was, seem to be much quicker than on a pi3. Also installed termux api node.

I cant seems to get the termux api node to work as there is not much documentation on the subject.


Debug msg reported ""SyntaxError: Unexpected end of JSON input"

There is no setting on the battery status node.


Seems that the node expect some specific json format?



Well, a quick scan of the code on github shows that this node is just using exec to run the termux-battery-status command, and parses the resulting string as JSON.

It also looks like the code is almost 2 years old -- so my guess is that either the underlying termux command output has changed, or the exec command is not working correctly. Probably best to raise an issue on the code in its github repo, and hope the author is still active.


Hi @shrickus, thanks for that clue, indeed the node seem to make an exec call and pass the result back as a json object.

Looks like I have to install two more files, first install termux api in playstore (which I did), but I did not install pkg install termux-api in the terminal and that seems to be the issue as I wrongly assume that by installing termux api in playstore will take care of everything.

Also you are spot on about outdated commands, as some of the command have changed, for example "sms in" has changed to "sms list".

This is opening a whole array of sensors one could use, great!


1 Like