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!