so the payload is a buffer and you need to change it to a string to be able to use in a switch node. One way to do that is to use a function node with something like this:
// move msg.payload to a variable 'buf'
var buf = msg.payload;
// convert 'buf' to a string
var str = buf.toString();
// move the string back to msg.payload
msg.payload = str;
// return the msg
return msg;
// this is a 'condensed' version
//msg.payload = msg.payload.toString();
//return msg;
ok, it works.
after two days, dpi nodered doesn't start
19 Mar 21:16:17 - [info] Starting flows
19 Mar 21:16:17 - [info] Started flows
19 Mar 21:16:17 - [error] Unable to listen on http://127.0.0.1:1880/
19 Mar 21:16:17 - [error] Error: port in use
Once Node-RED has started, point a browser at http://192.168.1.128:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
20 Mar 07:29:55 - [info]
Welcome to Node-RED
20 Mar 07:29:55 - [info] Node-RED version: v0.18.7
20 Mar 07:29:55 - [info] Node.js version: v10.9.0
20 Mar 07:29:55 - [info] Linux 4.14.52-v7+ arm LE
20 Mar 07:29:56 - [info] Loading palette nodes
20 Mar 07:29:58 - [info] Dashboard version 2.14.0 started at /ui
20 Mar 07:29:59 - [info] Settings file : /home/pi/.node-red/settings.js
20 Mar 07:29:59 - [info] HTTP Static : /home/pi/Pictures
20 Mar 07:29:59 - [info] User directory : /home/pi/.node-red
20 Mar 07:29:59 - [warn] Projects disabled : editorTheme.projects.enabled=false
20 Mar 07:29:59 - [info] Flows file : /home/pi/.node-red/flows_EURON8.json
20 Mar 07:29:59 - [info] Server now running at http://127.0.0.1:1880/
20 Mar 07:29:59 - [warn]
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
20 Mar 07:29:59 - [info] Starting flows
20 Mar 07:29:59 - [info] Started flows