On Tuesday, March 18th, 2025 at 2:06 PM, Stuart Henderson 
<s...@spacehopper.org> wrote:

> On 2025/03/18 07:36, Aaron Bieber wrote:
> 
> > On 3/17/25 11:55, Stuart Henderson wrote:
> > 
> > > On 2025/03/17 16:51, open...@systemfailure.net wrote:
> > > 
> > > > On Monday, March 17th, 2025 at 11:56 AM, Stuart Henderson 
> > > > s...@spacehopper.org wrote:
> > > > 
> > > > > On 2025/03/16 21:23, open...@systemfailure.net wrote:
> > > > > 
> > > > > > On 2025/03/14 14:13, Aaron Bieber aa...@bolddaemon.com wrote:
> > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > Here are updates to the Reticulum stack. Nomadnet runs fine for 
> > > > > > > me.
> > > > > > > 
> > > > > > > I'll probably commit this today or tomorrow if I no one objects.
> > > > > > > 
> > > > > > > Cheers,
> > > > > > > Aaron
> > > > > > > Hi, thanks for updating these ports.
> > > > > > 
> > > > > > py-rns-0.9.3 works fine, as far as I tested, but 'make test' fails: 
> > > > > > see the attached log file.
> > > > > > 
> > > > > > Moreover, it would be very useful to include a README for people 
> > > > > > wanting to use rnodeconf, since its usage on OpenBSD is not 
> > > > > > documented anywhere. Patch attached.
> > > > > > 
> > > > > > Best regards.
> > > > > 
> > > > > Here's a tiny tweak to your Makefile diff (tabs not spaces), and fix
> > > > > tests if cython is present when they're run.
> > > > > Thank you Stuart, 'make test' can now be run with your fix.
> > > > 
> > > > However, to make tests pass (at least most of them), I had to 
> > > > reintroduce another fix you submitted previously (the "pre-test" 
> > > > trick), that was forgotten by Aaron.
> > > > Ah yes, seems I had a /usr/local/bin/python lying around, probably
> > > > from last time I looked at this :)
> > > 
> > > > With the attached patch, all tests are passing except one - the one 
> > > > that was already failing. The port is running fine anyway.
> > > > +pre-test:
> > > > + ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
> > > 
> > > btw, usually just the one tab for instructions after targets like that.
> > > (no need to send a new diff for that).
> > > 
> > > I took a look at adafruit-nrfutil, seems it is not really compatible
> > > with Python 3.12, and it would be better to provide a port rather than
> > > ask people to use pip. (Would probably make sense to have it as a
> > > run dependency of py-rns so users don't have to mess about).
> > > 
> > > I've attached a first attempt at a port, there are patches to fix
> > > problems I saw with 'adafruit-nrfutil keys'. I don't have hardware to
> > > test any of the dfu bits.
> > 
> > Tried flashing a T-Echo with rnodeconf - it errors with:
> > 
> > Traceback (most recent call last):
> > File "/usr/local/bin/rnodeconf", line 8, in <module>
> > sys.exit(main())
> > ^^^^^^
> > File "/usr/local/lib/python3.12/site-packages/RNS/Utilities/rnodeconf.py",
> > line 1650, in main
> > if selected_port == None:
> > ^^^^^^^^^^^^^^^^^^^^^
> > File
> > "/usr/local/lib/python3.12/site-packages/serial/tools/list_ports_common.py",
> > line 74, in eq
> > return self.device == other.device
> > ^^^^^^^^^^^^
> > AttributeError: 'NoneType' object has no attribute 'device'
> > 
> > Seems our serial package is lacking something as the pip installed version
> > works.
> 
> 
> Here's a diff for ease of testing - have sent separately to the maintainer.
> 

So, I was finally able to test the following software stack...

- py3-serial 3.5 (updated by Stuart)
- adafruit-nrfutil
- py3-rns 0.9.3p0 (see patch below)
- py3-lxmf 0.6.3
- nomadnet 0.6.1

... with 2 LoRa RNode devices...

- LilyGo T-Echo (built around an nrf52 chip)
- Heltec LoRa32 v3 (built around an ESP32 chip)

... and I can confirm that everything is working perfectly as it should \o/

Both RNodes could be created/provisioned, configured and queried with rnodeconf.

I could also use them as LoRa modems with the Reticulum stack, to exchange 
messages and data.

Great job Stuart and Aaron.

Please find attached a new patch for py3-rns, where adafruit-nrfutil is set as 
a runtime dependency, and the Readme is updated.

Best regards.
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/py-rns/Makefile,v
diff -u -p -r1.2 Makefile
--- Makefile	15 Mar 2025 00:40:00 -0000	1.2
+++ Makefile	21 Mar 2025 15:52:11 -0000
@@ -3,6 +3,7 @@ COMMENT =		cryptography-based networking
 MODPY_DISTV =		0.9.3
 DISTNAME=		rns-${MODPY_DISTV}
 PKGNAME =		py-${DISTNAME}
+REVISION =		0
 
 CATEGORIES =		net devel
 
@@ -18,9 +19,15 @@ MODULES =		lang/python
 MODPY_PI =		Yes
 MODPY_PYBUILD =		setuptools
 
+# writes to $HOME if cython is installed
+PORTHOME =		${WRKDIR}
 MODPY_PYTEST_ARGS =	-v tests/all.py
 
 RUN_DEPENDS =		devel/py-serial \
 			security/py-cryptography
+			comms/adafruit-nrfutil
+
+pre-test:
+	ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
 
 .include <bsd.port.mk>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/py-rns/pkg/PLIST,v
diff -u -p -r1.2 PLIST
--- pkg/PLIST	15 Mar 2025 00:40:00 -0000	1.2
+++ pkg/PLIST	21 Mar 2025 15:52:11 -0000
@@ -274,3 +274,4 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/rns-${MODPY_DISTV}.dist-info/WHEEL
 lib/python${MODPY_VERSION}/site-packages/rns-${MODPY_DISTV}.dist-info/entry_points.txt
 lib/python${MODPY_VERSION}/site-packages/rns-${MODPY_DISTV}.dist-info/top_level.txt
+share/doc/pkg-readmes/${PKGSTEM}
Index: pkg/README
===================================================================
RCS file: pkg/README
diff -N pkg/README
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/README	21 Mar 2025 15:52:11 -0000
@@ -0,0 +1,29 @@
++-----------------------------------------------------------------------
+| Running ${PKGSTEM} on OpenBSD
++-----------------------------------------------------------------------
+
+Connect to RNodes over USB
+==========================
+
+To access RNodes over an USB cable, the user must be in the dialer
+group:
+
+	usermod -G dialer <user>
+
+The corresponding virtual device will most often be /dev/cuaU0, or if
+you have multiple serial devices connected over USB, /dev/cuaU1,
+/dev/cuaU2, and so on. See cua(4) for explanations.
+
+For example, you could get info about your RNode with rnodeconf by
+running:
+
+	rnodeconf --info /dev/cuaU0
+
+In your RNS configuration file (usually ~/.reticulum/config), your RNode
+interface could be defined like this:
+
+  [[RNode LoRa Interface]]
+    type = RNodeInterface
+    enabled = yes
+    port = /dev/cuaU0
+    ...

Reply via email to