Trying to Build Helium Packet Miner but the Packet-Forwarding wont Deploy.

Hey Everyone,

I was hoping to get some advice on why my packet-forwarding helium miner thingy is not working. I been trying to figure out what the problem is and how to fix it, at this point all I been able to do is find the issue. I was hoping someone can help me with the fixing the issue part.

Below I pasted the error portion of my log.

[Error] Some services failed to build:
[Error] Service: packet-forwarder
[Error] Error: The command ‘/bin/sh -c ./buildfiles/compileSX1301.sh spidev0.0’ returned a non-zero code: 1
[Info] Built on arm04
[Error] Not deploying release.

Thank you all for the help I really appreciate it.

Hello,
Can you share some more details about exactly what/how you are trying to build? It would help us narrow down the issue if you could share console logs, and preferably your docker-compose/Dockerfile files (to whatever extent you find comfortable).
Also do share what OS and program versions you are using to build.

Thanks and regards,
Pranav

Hey,

Thanks for getting back to me, I will try to provide as much of the info you requested as possible.

so I am trying to build this Data Only Hotspot with balena + Raspberry Pi + RAK Concentrator RAK2287 | Helium Documentation using this source GitHub - mpous/helium-data-hotspot

I am using a raspberry pi 3 B+ model and using windows 10 on my desktop.

The docker compose :
version: ‘2.4’
services:
packet-forwarder:
build:
context: ./hm-pktfwd
privileged: true
volumes:
- ‘pktfwdr:/var/pktfwd’
helium-miner:
build:
context: ./hm-gatewayrs
expose:
- ‘1680’
ports:
- ‘44158:44158/tcp’
volumes:
- ‘miner-storage:/var/data’
- ‘miner-log:/var/log/miner’
- ‘pktfwdr:/var/pktfwd’
cap_add:
- SYS_RAWIO
devices:
- ‘/dev/i2c-1:/dev/i2c-1’
environment:
DBUS_SYSTEM_BUS_ADDRESS: ‘unix:path=/host/run/dbus/system_bus_socket’
RELEASE_BUMPER: foobar
labels:
io.balena.features.dbus: ‘1’
volumes:
miner-storage: {}
miner-log: {}
pktfwdr: {}

docker files:

Packet Forwarder Docker File

(C) Nebra Ltd 2019

Licensed under the MIT License.

####################################################################################################
################################## Stage: builder ##################################################

FROM balenalib/raspberry-pi-debian:buster-build as builder

Move to correct working directory

WORKDIR /opt/iotloragateway/dev

Copy python dependencies for pip install later

COPY requirements.txt requirements.txt

This will be the path that venv uses for installation below

ENV PATH="/opt/iotloragateway/dev/venv/bin:$PATH"

Install build tools

hadolint ignore=DL3008

RUN apt-get update &&
apt-get -y install --no-install-recommends
automake
libtool
autoconf
git
ca-certificates
pkg-config
build-essential
python3
python3-pip
python3-venv

# Because the PATH is already updated above, this command creates a new venv AND activates it
# Given venv is active, this `pip` refers to the python3 variant

RUN python3 -m venv /opt/iotloragateway/dev/venv &&
pip install --no-cache-dir -r requirements.txt

Copy the buildfiles and sx1302 concentrator fixes

COPY buildfiles buildfiles
COPY sx1302fixes sx1302fixes

Clone the lora gateway and packet forwarder repos

RUN git clone GitHub - NebraLtd/lora_gateway: Driver/HAL to build a gateway using a concentrator board based on Semtech SX1301 multi-channel modem and SX1257/SX1255 RF transceivers.
RUN git clone GitHub - NebraLtd/packet_forwarder: A LoRa packet forwarder is a program running on the host of a LoRa gateway that forwards RF packets receive by the concentrator to a server through a IP/UDP link, and emits RF packets that are sent by the server.

Create folder needed by packetforwarder compiler

RUN mkdir -p /opt/iotloragateway/packetforwarder

Compile for sx1301 concentrator on all the necessary SPI buses

RUN ./buildfiles/compileSX1301.sh spidev0.0
RUN ./buildfiles/compileSX1301.sh spidev0.1
RUN ./buildfiles/compileSX1301.sh spidev1.0
RUN ./buildfiles/compileSX1301.sh spidev1.1
RUN ./buildfiles/compileSX1301.sh spidev1.2
RUN ./buildfiles/compileSX1301.sh spidev2.0
RUN ./buildfiles/compileSX1301.sh spidev2.1
RUN ./buildfiles/compileSX1301.sh spidev32766.0

Compile for sx1302 concentrator

RUN ./buildfiles/compileSX1302.sh

No need to cleanup the builder

####################################################################################################
################################### Stage: runner ##################################################

FROM balenalib/raspberry-pi-debian:buster-run as runner

Start in sx1301 directory

WORKDIR /opt/iotloragateway/packet_forwarder/sx1301

Install python3-venv and python3-rpi.gpio

hadolint ignore=DL3008

RUN apt-get update &&
apt-get -y install
python3-venv
python3-rpi.gpio &&
apt-get autoremove -y &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

Copy sx1301 packetforwader from builder

COPY --from=builder /opt/iotloragateway/packetforwarder .

Copy sx1301 regional config templates

COPY lora_templates_sx1301 lora_templates_sx1301/

Use EU config as initial default

COPY lora_templates_sx1301/local_conf.json local_conf.json
COPY lora_templates_sx1301/EU-global_conf.json global_conf.json

Move to sx1302 directory

WORKDIR /opt/iotloragateway/packet_forwarder/sx1302

Copy sx1302 hal from builder

COPY --from=builder /opt/iotloragateway/dev/sx1302_hal-1.0.5 .

Copy sx1302 regional config templates

COPY lora_templates_sx1302 lora_templates_sx1302/

Use EU config as initial default

COPY lora_templates_sx1302/local_conf.json packet_forwarder/local_conf.json
COPY lora_templates_sx1302/EU-global_conf.json packet_forwarder/global_conf.json

Move to main packet forwarder directory and copy source code

WORKDIR /opt/iotloragateway/packet_forwarder
COPY files/* ./

Copy venv from builder and update PATH to activate it

COPY --from=builder /opt/iotloragateway/dev/venv /opt/iotloragateway/dev/venv
ENV PATH="/opt/iotloragateway/dev/venv/bin:$PATH"

Run run_pkt script

ENTRYPOINT [“sh”, “/opt/iotloragateway/packet_forwarder/run_pkt.sh”]

Thanks for the help.

1 Like

Hello @TheElderOtter welcome to the balena community and thanks for trying the project.

Actually i accepted a PR a couple of days ago that solve this building issue. Could you please try?

Sorry for the delay of getting back to you I been out of town for last couple of weeks. I tried doing it again and I got the same issue, given idk if the website I am going to is the updated one or if it is the old one. GitHub - just4give/helium-dyi-hotspot-balena-pi4 . is there a better place I should be going to?

Thank you.

1 Like

Thank you for your message @TheElderOtter let me replicate this and try to find a solution!

Hey,

were you ever able to find a solution to the problem by any chance?

1 Like

Hello @TheElderOtter i’m working on this this week! i will keep you updated!

I’m working on this branch GitHub - mpous/helium-data-hotspot at new_pktfwd

However i’m still having problems with the gateway_key.bin generated here helium-data-hotspot/start-gatewayrs.sh at 84de5f234f42aec784b2249176b3887309f49045 · mpous/helium-data-hotspot · GitHub

I will keep you updated!

Hi @mpous I have the same issue, compiling from Ubuntu in WSL, I will check the new branch and see if it improves.

I am trying to adapt to a SX1301, but still doesn’t compile

1 Like

Here’s what I did to fix the compiling issue, but first my setup>
Windows 11 using VSCODE inside WSL2 (Ubuntu)
changed the permissions of the two files compileSX1301.sh and compileSX1302.sh with chmod +x compileSX130*
Changed the Line ending from CRLF to LF
image
and after that “voila”

Now I will try to add my personal SX1301 gateway (based on RAK2245) and start adapting to that, from the code I see there is a work done towards it, and it is pretty much compatible, most likely just connecting some missing cable somewhere in the code.

1 Like

After fixing all executable files, [.sh] with correct permissions, and fine touch to add the RAK2245, the concentrator started and pktfwd.

Now having an issue to add the hotspot to Helium, getting this error>
ConnectError(“tcp connect error”, Os { code: 111, kind: ConnectionRefuse…

This doesn’t allow me to execute the very first command to add the hotspot and then pay for it…

1 Like

Exactly @ronyvargas i’m having the same issue …

helium changed the grpc service. And I think we may need to update to default.toml? gateway-rs/default.toml at main · helium/gateway-rs · GitHub

1 Like

Let me take a look to that link

1 Like

Made it to work, I had to modify the start-gatewayrs.sh in order to made it work

beware that my work was towards adding the RAK2245 so, I have other mods in the packet_forwarder that are not needed if using the RAK2287, so I did two commits to make simple to see my mods, still dirty mods, trying to put them nice, but at least works. :slight_smile:
check out the specific commit from Github:
FIX start-gatewayrs.sh after ALPHA-21 · rony-vargas/helium-data-hotspot@7fe3e8c (github.com)

1 Like

Hey @ronyvargas i’m preparing a big PR, but it’s still not ready. I will check your PR on Monday to see how does it match with the changes i’m doing :slight_smile:

1 Like

@ronyvargas did you try the last PR? :slight_smile:

1 Like

Hi @mpous I have compiled and uploaded the new code to the device and it looks is working correctly so far with no mods from my side


image
I will now add some node to test complete flow, but so far looks promising, btw I am using the variant: ‘DIY-PISLGH’ for my RAK-2245 (SX1301)

1 Like

@ronyvargas what region are you based? US915?

1 Like

Yes @mpous , my frequency region is US915