Hello,
I am using BalenaOS on my Raspberry Pi 4. I have provided both WiFi and Ethernet to my Balena Device in which WiFi is for Internet connection and Ethernet(with different router then Internet connection) is used for communicating with the devices that are connected to the same router. But this setup causes my Balena device to shutdown after 1:30 hours.
I just want to know what am I doing wrong here.
Thank you.
Can you provide details of your setup, how many containers? The Docker file(s) and Docker Compose file if you have multiple containers running.
Have you tried simplifying you testing and just one network connection as a test?
Hi, does it happen on more than one device or is it isolated to just one?
It is Isolated to just one and I have only added one device in my fleet.
Yes, I have tried using only WiFi network connection and it was working perfectly this issue only occurs in case of Ethernet with WiFi.
I have Raspberry Pi 4 (using 64bit OS) running BalenaOS v2.108.27 (recommended) in development mode. My BalenaOS is running 3 containers and these are :-
- balena-nodejs-hello-world
- wifi-connect
- test-bench
→ Dockerfile.template of balena-nodejs-hello-world
FROM balenalib/%%BALENA_ARCH%%-node:14-buster-run
WORKDIR /usr/src/app
COPY package*.json ./
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*
COPY . ./
CMD [“npm”, “start”]
→ Dockerfile.template of wifi-connect
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian
RUN install_packages dnsmasq wireless-tools
WORKDIR /usr/src/app
ARG VERSION="4.4.0"
RUN curl -Ls "https://github.com/balena-io/wifi-connect/releases/download/v$VERSION/wifi-connect-v$VERSION-linux-%%BALENA_ARCH%%.tar.gz" \
| tar -xvz -C /usr/src/app/
COPY scripts/start.sh .
CMD ["bash", "start.sh"]
→ Dockerfile.template of test-bench
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --production
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD ["yarn", "start"]
→ docker-compose.yml
version: ‘2’
services:
wifi-connect:
build: ./wifi-connect
network_mode: “host”
labels:
io.balena.features.dbus: ‘1’
cap_add:
- NET_ADMIN
environment:
DBUS_SYSTEM_BUS_ADDRESS: “unix:path=/host/run/dbus/system_bus_socket”
hello-world:
build: ./balena-nodejs-hello-world
ports:
- “80:80”
test-bench:
build: ./test-bench
ports:
- “3000:3000”
@mani13jha could you please confirm what hardware do you use? what power adaptor? Thanks!
@mpous
Hardware:- Raspberry Pi 4 Mode B with 4 GB RAM
Storage:- SandDisk Ultra 32GB Class10
Power:- Fedus 15Watt (5Volts, 3.1 Amps) Type C Power Adapter
@mani13jha did you try to change your power supply and check?
No. It was working perfectly when I am using WiFi with my Fleet Device, so power supply issue never occur to me.
I will try to change the power supply and then update you if the issue still persist.
Thank you.
Thanks @mani13jha sometimes it’s good to discard any hardware issue! Let’s stay connected!