From a50ee8622fe2a32d093b97b650b7cf350d36db13 Mon Sep 17 00:00:00 2001 From: oe6dxd Date: Sun, 1 Feb 2026 13:30:52 +0100 Subject: [PATCH] updated doku --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 374645d..41c0559 100644 --- a/README.md +++ b/README.md @@ -33,14 +33,38 @@ We build a robot with raspberry and arduino. sudo systemctl restart nginx ### Test Face Server -In Browser: +#### In Browser http://pi-ip/ -From Somewhere: +#### From Somewhere - curl -X POST http://pi-ip/api/emotion/happy - curl -X POST http://pi-ip/api/emotion/angry - curl -X POST http://pi-ip/api/emotion/sleepy +`Neutral + wander` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"emotion":"neutral","intensity":0.6,"look":null}' + +`Angry + starring right` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"emotion":"angry","intensity":0.9,"look":{"x":0.9,"y":0.0}}' + +`start Talking` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"talk":{"enabled":true}}' + +`talk faster and stronger` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"talk":{"enabled":true,"rate_hz":5.5,"amount":1.0,"jitter":0.35}}' + +`stop talking` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"talk":{"enabled":false}}' + +`emotion + talk` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"emotion":"happy","intensity":0.85,"talk":{"enabled":true,"rate_hz":4.2,"amount":0.95}}' + +`blink + happy` + curl -X POST http:///api/state -H "Content-Type: application/json" \ + -d '{"emotion":"happy","blink":true,"intensity":0.85}' ### systemd Service sudo ln -s /opt/helva-robot/face/etc/systemd/system/face.service /etc/systemd/system/ @@ -53,5 +77,40 @@ Start: sudo systemctl enable --now face.service sudo systemctl status face.service --no-pager +### Debug Face + +#### SSE-Stream going to browser? + curl -N http://127.0.0.1:8001/events | head + +#### is nginx delivering /events through + curl -N http://localhost/events | head + +#### check Endpoint /api/state +`directly` + curl -s -X POST http://127.0.0.1:8001/api/state \ + -H "Content-Type: application/json" \ + -d '{"emotion":"happy","intensity":0.9,"blink":true}' | jq + +`throught nginx` + curl -s -X POST http://localhost/api/state \ + -H "Content-Type: application/json" \ + -d '{"emotion":"happy","intensity":0.9,"blink":true}' + +#### check python face server + sudo systemctl status face.service --no-pager + sudo journalctl -u face.service -n 50 --no-pager + +#### restart/reload face server service + sudo systemctl daemon-reload + sudo systemctl restart face.service + +#### check listening Port + sudo ss -ltnp | grep :8001 + +#### restart/status of face service + sudo systemctl restart face.service + sudo systemctl status face.service --no-pager + +## Arduino Motor Steering