dev_kevin
@kevinanderson25 · Mitglied seit Juli 2025
Backend developer · software · new to IoT
- Themen
- 5
- Antworten
- 38
- Punkte
- 0
Erstellte Forenantworten
Deployed the median on the boards and this rule on Monday. 3 e-mails all week, each one a dispenser that was actually almost empty. The supervisor asked if she can get the toilet roll ones in the morning only, but that’s a problem for next week.
Von English mit KI übersetzt ·
Ich bin kein Edge-Nutzer, aber könnte man nicht vom Router aus ein VPN zurück zu Ihrem Büro aufbauen? Das haben wir einmal für eine Web-App so gemacht.
Not an Edge user, but couldn’t you run a VPN from the router back to your office? That’s what we did for a web app once.
Von English mit KI übersetzt ·
Entschuldigung, Anfängerfrage: Was ist der Katalog? Ist das etwas, das man im Profil einrichtet?
Sorry, newbie question, what’s the catalogue? Is that something you set up in the profile?
The „8 channels times every SF in parallel“ bit is what I was missing. Bought one with Basics Station support, followed the Connect a Basics Station gateway page, it showed Online within a minute. Our two test sensors at the far end of the office come in at around -105 dBm, fine for now.
Von English mit KI übersetzt ·
Ist es sicher, einmal auf Not-Halt zu drücken, um zu sehen, was er bewirkt? Ich möchte nicht, dass die Speicherung unserer Gerätedaten aufhört.
Is it safe to press Emergency stop once to see what it does? I don’t want our device data to stop being stored.
Von English mit KI übersetzt ·
Ich bin neu auf der Hardware-Seite, habe aber jahrelang serielle Protokolle in Software umgesetzt, und man kann das mit Parität nachbilden. Das 9. Bit wird dort gesendet, wo das Paritätsbit stehen würde. Linux unterstützt „Stick“-Parität über das CMSPAR-Flag: Mit PARENB|CMSPAR|PARODD ist das Paritätsbit immer 1 (Mark), ohne PARODD immer 0 (Space).Also: Mark-Parität setzen, das Adressbyte schreiben, warten bis es hinaus ist (tcdrain), auf Space-Parität umschalten, die Datenbytes schreiben. In Python:
import termios, serial
CMSPAR = 0o10000000000
s = serial.Serial('/dev/ttyAMA0', 9600)
def set_bit9(on):
a = termios.tcgetattr(s.fd)
a[2] |= termios.PARENB | CMSPAR
a[2] = a[2] | termios.PARODD if on else a[2] & ~termios.PARODD
termios.tcsetattr(s.fd, termios.TCSADRAIN, a)
set_bit9(True); s.write(bytes([0x03])); s.flush()
set_bit9(False); s.write(bytes([0x10, 0x00]))
Der Empfang ist die unangenehmere Hälfte: PARMRK und INPCK aktivieren, dann kommt ein Byte mit der „falschen“ Parität mit dem Präfix 0xFF 0x00 an, das dir sein 9. Bit verrät. Bei 9600 entsteht zwischen Adress- und Datenbytes durch das Umschalten eine kleine Lücke, die meisten alten Geräte stört das nicht. Verwende den PL011-UART (disable-bt), nicht den Mini-UART, denn der Mini-UART hat keine Parität.Dann wird jeder Indikator als Kind gesendet, etwa so: {„scale-1“: {„values“: {„kg“: 12.45}}} auf v1/gw/telemetry.
I’m new to the hardware side but I did serial protocol work in software for years, and you can fake this with parity. The 9th bit is sent where the parity bit would be. Linux supports „stick“ parity through the CMSPAR flag: with PARENB|CMSPAR|PARODD the parity bit is always 1 (mark), without PARODD it’s always 0 (space).
So: set mark parity, write the address byte, wait for it to leave (tcdrain), switch to space parity, write the data bytes. In Python:
import termios, serial
CMSPAR = 0o10000000000
s = serial.Serial('/dev/ttyAMA0', 9600)
def set_bit9(on):
a = termios.tcgetattr(s.fd)
a[2] |= termios.PARENB | CMSPAR
a[2] = a[2] | termios.PARODD if on else a[2] & ~termios.PARODD
termios.tcsetattr(s.fd, termios.TCSADRAIN, a)
set_bit9(True); s.write(bytes([0x03])); s.flush()
set_bit9(False); s.write(bytes([0x10, 0x00]))
Receiving is the uglier half: turn on PARMRK and INPCK and a byte with the „wrong“ parity arrives prefixed with 0xFF 0x00, which tells you its 9th bit. At 9600 the timing between the address and the data bytes gets a small gap from switching, most old devices don’t care. Use the PL011 UART (disable-bt), not the mini UART, the mini UART has no parity.
Then each indicator goes out as a child, something like {„scale-1“: {„values“: {„kg“: 12.45}}} on v1/gw/telemetry.
Von English mit KI übersetzt ·
Ist ttyAMA0 so etwas wie USB? Ich dachte immer, ACM/USB-Namen seien für USB.
Is ttyAMA0 a USB thing? I always thought ACM/USB names were for USB.
Von English mit KI übersetzt ·
Das waren zwei Fehler: der Token und der fehlende Teil /tenant/<tenantId> (nachdem ich den Schlüssel hatte, kam einmal 404, dann habe ich es bemerkt). Läuft jetzt mit 30 s und einem schreibgeschützten Schlüssel, der auf unsere IP beschränkt ist. Der Summer ging heute Morgen los, als sie ihn gefüllt haben, also funktioniert es.
That was two bugs, the token and the missing /tenant/<tenantId> bit (got a 404 once I had the key, then saw it). Running at 30 s now with a read-only key locked to our IP. Buzzer went off this morning when they filled it, so it works.
The payload isn’t null-terminated, so reading it as a C string runs past the end. That’s the random number.
Von English mit KI übersetzt ·
Was ist MQTT-SN, ist es ein anderes MQTT?
What is MQTT-SN, is it a different MQTT?
What happens to the cumulative count when the ESP reboots? It starts at 0 again.
Von English mit KI übersetzt ·
Fair genug, ausgehend ist sauberer. Meinen Tipp zur Portweiterleitung nehme ich zurück.
Fair enough, outbound is cleaner. Taking my port forwarding advice back.
Von English mit KI übersetzt ·
Portweiterleitung am Router funktioniert, das habe ich einmal für eine Kamera gemacht. Wähl einfach einen hohen Port.
Port forwarding on the router works, I did that for a camera once. Just pick a high port.
Could you only send the battery value once an hour? Then it can’t flap as much.
Is the antenna actually an 868 one? The 915 ones look the same.

