Local Mode not working

Having succesfully deployed an app using the Cloud I thought I would try Local Mode. I followed the instructions and it all appeared to be progressing, but it ended with an error which just repeated. See below:

PS C:\balena\train-display> balena push 192.168.1.24
[Info]    Starting build on device 192.168.1.24
[Info]    No "docker-compose.yml" file found at "."
[Info]    Creating default composition with source: "."
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-v10.6.27.img (1).zip
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-v10.6.27.img.zip
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\old_balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-v10.6.27.img.zip
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-dev-v10.6.27.img.zip
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\balena-cloud-Train_Display-raspberrypi3-2.47.0+rev1-v10.6.27.img.zip
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-v10.6.27.img (2).zip
[Warn]    CRLF (Windows) line endings detected in file: C:\balena\train-display\example_balena_wifi_setup.txt
[Warn]    CRLF detection skipped for large file: C:\balena\train-display\new_balena-cloud-Train_Display-raspberry-pi-2.46.1+rev1-v10.6.27.img.zip
[Build]   [main] Step 1/12 : FROM balenalib/raspberry-pi-debian-python:3.7-buster-build
[Build]   [main]  ---> 31b9693234ae
[Build]   [main] Step 2/12 : RUN install_packages         jq         moreutils         libopenjp2-7         libfreetype6-dev         libjpeg-dev         libtiff5
[Build]   [main]  ---> Running in 0e2ca6d0dad3
[Build]   [main] Reading package lists...
[Build]   [main] Building dependency tree...
[Build]   [main] Reading state information...
[Build]   [main] libjpeg-dev is already the newest version (1:1.5.2-2).
[Build]   libopenjp2-7 is already the newest version (2.3.0-2+deb10u1).
[Build]   libopenjp2-7 set to manually installed.
[Build]   libtiff5 is already the newest version (4.1.0+git191117-2~deb10u1).
[Build]   libtiff5 set to manually installed.
[Build]   The following additional packages will be installed:
[Build]   [main]   libio-pty-perl libipc-run-perl libjq1 libonig5 libpng-dev
[Build]   [main] Suggested packages:
[Build]   [main]   freetype2-doc libtime-duration-perl libtimedate-perl
[Build]   [main] Recommended packages:
[Build]     libpng-tools
[Build]   [main] The following NEW packages will be installed:
[Build]   [main]   jq libfreetype6-dev libio-pty-perl libipc-run-perl libjq1 libonig5
[Build]   [main]   libpng-dev moreutils
[Build]   [main] 0 upgraded, 8 newly installed, 0 to remove and 5 not upgraded.
[Build]   Need to get 1292 kB of archives.
[Build]   After this operation, 4275 kB of additional disk space will be used.
[Build]   Get:1 http://archive.raspbian.org/raspbian buster/main armhf libonig5 armhf 6.9.1-1 [150 kB]
[Build]   [main] Get:2 http://archive.raspbian.org/raspbian buster/main armhf libjq1 armhf 1.5+dfsg-2+b1 [119 kB]
[Build]   [main] Get:3 http://archive.raspbian.org/raspbian buster/main armhf jq armhf 1.5+dfsg-2+b1 [59.3 kB]
[Build]   [main] Get:4 http://archive.raspbian.org/raspbian buster/main armhf libpng-dev armhf 1.6.36-6 [281 kB]
[Build]   [main] Get:5 http://archive.raspbian.org/raspbian buster/main armhf libfreetype6-dev armhf 2.9.1-3+deb10u1 [479 kB]
[Build]   [main] Get:6 http://archive.raspbian.org/raspbian buster/main armhf libio-pty-perl armhf 1:1.08-1.1+b4 [33.0 kB]
[Build]   [main] Get:7 http://archive.raspbian.org/raspbian buster/main armhf libipc-run-perl all 20180523.0-1 [101 kB]
[Build]   [main] Get:8 http://archive.raspbian.org/raspbian buster/main armhf moreutils armhf 0.62-1+b1 [69.3 kB]
[Build]   [main] debconf: delaying package configuration, since apt-utils is not installed
[Build]
[Build]   [main] Fetched 1292 kB in 1s (1483 kB/s)
[Build]   [main] Selecting previously unselected package libonig5:armhf.
[Build]   [main]
[Build]   (Reading database ...
[Build]   [main] (Reading database ... 5%
[Build]   [main] (Reading database ... 10%
[Build]   [main] (Reading database ... 15%
[Build]   [main] (Reading database ... 20%
[Build]   [main] (Reading database ... 25%
[Build]   [main] (Reading database ... 30%
[Build]   [main] (Reading database ... 35%
(Reading database ... 55% database ... 40%
(Reading database ... 90% database ... 60%
(Reading database ... 20403 files and directories currently installed.)
[Build]   [main] Preparing to unpack .../0-libonig5_6.9.1-1_armhf.deb ...
[Build]   [main] Unpacking libonig5:armhf (6.9.1-1) ...
[Build]   [main] Selecting previously unselected package libjq1:armhf.
[Build]   [main] Preparing to unpack .../1-libjq1_1.5+dfsg-2+b1_armhf.deb ...
[Build]   [main] Unpacking libjq1:armhf (1.5+dfsg-2+b1) ...
[Build]   [main] Selecting previously unselected package jq.
[Build]   [main] Preparing to unpack .../2-jq_1.5+dfsg-2+b1_armhf.deb ...
[Build]   [main] Unpacking jq (1.5+dfsg-2+b1) ...
[Build]   [main] Selecting previously unselected package libpng-dev:armhf.
[Build]   [main] Preparing to unpack .../3-libpng-dev_1.6.36-6_armhf.deb ...
[Build]   [main] Unpacking libpng-dev:armhf (1.6.36-6) ...
[Build]   [main] Selecting previously unselected package libfreetype6-dev:armhf.
[Build]   [main] Preparing to unpack .../4-libfreetype6-dev_2.9.1-3+deb10u1_armhf.deb ...
[Build]   [main] Unpacking libfreetype6-dev:armhf (2.9.1-3+deb10u1) ...
[Build]   [main] Selecting previously unselected package libio-pty-perl.
[Build]   [main] Preparing to unpack .../5-libio-pty-perl_1%3a1.08-1.1+b4_armhf.deb ...
[Build]   [main] Unpacking libio-pty-perl (1:1.08-1.1+b4) ...
[Build]   [main] Selecting previously unselected package libipc-run-perl.
[Build]   [main] Preparing to unpack .../6-libipc-run-perl_20180523.0-1_all.deb ...
[Build]   [main] Unpacking libipc-run-perl (20180523.0-1) ...
[Build]   [main] Selecting previously unselected package moreutils.
[Build]   [main] Preparing to unpack .../7-moreutils_0.62-1+b1_armhf.deb ...
[Build]   [main] Unpacking moreutils (0.62-1+b1) ...
[Build]   [main] Setting up libio-pty-perl (1:1.08-1.1+b4) ...
[Build]   [main] Setting up libpng-dev:armhf (1.6.36-6) ...
[Build]   [main] Setting up libfreetype6-dev:armhf (2.9.1-3+deb10u1) ...
[Build]   [main] Setting up libipc-run-perl (20180523.0-1) ...
[Build]   [main] Setting up libonig5:armhf (6.9.1-1) ...
[Build]   [main] Setting up moreutils (0.62-1+b1) ...
[Build]   [main] Setting up libjq1:armhf (1.5+dfsg-2+b1) ...
[Build]   [main] Setting up jq (1.5+dfsg-2+b1) ...
[Build]   [main] Processing triggers for libc-bin (2.28-10+rpi1) ...
[Build]   [main] Removing intermediate container 0e2ca6d0dad3
[Build]   [main]  ---> d5ff28bd910d
[Build]   [main] Step 3/12 : WORKDIR /usr/app
[Build]   [main]  ---> Running in cdc37b2ea228
[Build]   [main] Removing intermediate container cdc37b2ea228
[Build]   [main]  ---> 3cd440f258de
[Build]   [main] Step 4/12 : COPY ./requirements.txt .
[Build]   [main]  ---> 53615d4a2b87
[Build]   [main] Step 5/12 : RUN pip install -r requirements.txt
[Build]   [main]  ---> Running in e794b340a980
[Build]   [main] Collecting luma.oled
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/b0/fa/ef1065ad3644608d6127ce05da43b2b6ab1857b5b26983439f696bab6f4a/luma.oled-3.4.0-py2.py3-none-any.whl
[Build]   [main] Collecting timeloop
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/6a/95/3e39ee32f15a8e9dea46bb52300611a5351964eeaa393bafb0d738e90ce0/timeloop-1.0.2.tar.gz
[Build]   [main] Collecting requests
[Build]   [main]   Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
[Build]   [main] Collecting luma.core>=1.12.0
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/90/51/ae30ce7c3ef0698547b77cb3263f17f49345f33e360af8032f86c0f6dcf6/luma.core-1.14.0-py2.py3-none-any.whl (51kB)
[Build]   [main] Collecting idna<3,>=2.5
[Build]   [main]   Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
[Build]   [main] Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
[Build]   [main]   Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
[Build]   [main] Collecting certifi>=2017.4.17
[Build]   [main]   Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
[Build]   [main] Collecting chardet<4,>=3.0.2
[Build]   [main]   Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
[Build]   [main] Collecting pillow>=4.0.0
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/c7/04/c91bb0e495c1e8a09633ecb061fab32e276ace7cefcef5d12334cdd14cd2/Pillow-7.1.1.tar.gz (38.9MB)
[Build]   [main] Collecting RPI.GPIO; platform_system == "Linux"
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/cb/88/d3817eb11fc77a8d9a63abeab8fe303266b1e3b85e2952238f0da43fed4e/RPi.GPIO-0.7.0.tar.gz
[Build]   [main] Collecting spidev; platform_system == "Linux"
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz
[Build]   [main] Collecting smbus2
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/6a/06/80a6928e5cbfd40c77c08e06ae9975c2a50109586ce66435bd8166ce6bb3/smbus2-0.3.0.tar.gz
[Build]   [main] Collecting pyftdi
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/ee/7c/7b6c705b60159806c073e5539a233813f10b1c0c9a11a824b1a27ddddaad/pyftdi-0.50.0-py36-none-any.whl (148kB)
[Build]   [main] Collecting pyusb>=1.0.0
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/5f/34/2095e821c01225377dda4ebdbd53d8316d6abb243c9bee43d3888fa91dd6/pyusb-1.0.2.tar.gz (54kB)
[Build]   [main] Collecting pyserial>=3.0
[Build]   [main]   Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193kB)
[Build]   [main] Installing collected packages: pillow, RPI.GPIO, spidev, smbus2, pyusb, pyserial, pyftdi, luma.core, luma.oled, timeloop, idna, urllib3, certifi, chardet, requests
[Build]   [main]     Running setup.py install for pillow: started
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: still running...
[Build]   [main]     Running setup.py install for pillow: finished with status 'done'
[Build]   [main]     Running setup.py install for RPI.GPIO: started
[Build]   [main]     Running setup.py install for RPI.GPIO: finished with status 'done'
[Build]   [main]     Running setup.py install for spidev: started
[Build]   [main]     Running setup.py install for spidev: finished with status 'done'
[Build]   [main]     Running setup.py install for smbus2: started
[Build]   [main]     Running setup.py install for smbus2: finished with status 'done'
[Build]   [main]     Running setup.py install for pyusb: started
[Build]   [main]     Running setup.py install for pyusb: finished with status 'done'
[Build]   [main]     Running setup.py install for timeloop: started
[Build]   [main]     Running setup.py install for timeloop: finished with status 'done'
[Build]   [main] Successfully installed RPI.GPIO-0.7.0 certifi-2020.4.5.1 chardet-3.0.4 idna-2.9 luma.core-1.14.0 luma.oled-3.4.0 pillow-7.1.1 pyftdi-0.50.0 pyserial-3.4 pyusb-1.0.2 requests-2.23.0 smbus2-0.3.0 spidev-3.4 timeloop-1.0.2 urllib3-1.25.8
[Build]   [main] WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
[Build]   You should consider upgrading via the 'pip install --upgrade pip' command.
[Build]
[Build]   [main] Removing intermediate container e794b340a980
[Build]   [main]  ---> ef6fb43899b5
[Build]   [main] Step 6/12 : COPY src ./src
[Build]   [main]  ---> 7b18b8c2e6ec
[Build]   [main] Step 7/12 : COPY balena-run.sh ./
[Build]   [main]  ---> 83f7c256db99
[Build]   [main] Step 8/12 : COPY config.sample.json ./
[Build]   [main]  ---> 4fb3247a80e9
[Build]   [main] Step 9/12 : RUN chmod +x balena-run.sh
[Build]   [main]  ---> Running in 922723af3244
[Build]   [main] Removing intermediate container 922723af3244
[Build]   [main]  ---> 50b398e68e2e
[Build]   [main] Step 10/12 : CMD ./balena-run.sh
[Build]   [main]  ---> Running in ef069c042f10
[Build]   [main] Removing intermediate container ef069c042f10
[Build]   [main]  ---> 1309d4088c73
[Build]   [main] Step 11/12 : LABEL io.resin.local.image=1
[Build]   [main]  ---> Running in a30852ddd483
[Build]   [main] Removing intermediate container a30852ddd483
[Build]   [main]  ---> 4f5e966c77ce
[Build]   [main] Step 12/12 : LABEL io.resin.local.service=main
[Build]   [main]  ---> Running in 01aa8d938e45
[Build]   [main] Removing intermediate container 01aa8d938e45
[Build]   [main]  ---> 454c5b68bd40
[Build]   [main] Successfully built 454c5b68bd40
[Build]   [main] Successfully tagged local_image_main:latest

[Live]    Waiting for device state to settle...
[Info]    Streaming device logs...
[Live]    Watching for file changes...
[Warn]    Windows-format line endings were detected in some files. Consider using the `--convert-eol` option.
[Logs]    [2020-4-8 12:11:27] Creating volume 'resin-data'
[Logs]    [2020-4-8 12:11:27] Creating network 'default'
[Logs]    [2020-4-8 12:11:28] Installing service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:11:30] Installed service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:11:30] Starting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:11:41] Started service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:11:39] [main] .refreshTime=
[Logs]    [2020-4-8 12:11:39] [main] jq: error: syntax error, unexpected $end (Unix shell quoting issues?) at <top-level>, line 1:
[Logs]    [2020-4-8 12:11:39] [main] jq: 1 compile error
[Logs]    [2020-4-8 12:11:53] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:12:03] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:12:23] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:11:53] [main] Error: Expecting value: line 1 column 1 (char 0)
[Live]    Device state settled
[Logs]    [2020-4-8 12:12:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:12:34] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:12:43] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:12:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:12:48] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:12:55] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:13] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:12:48] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:13:18] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:13:23] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:33] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:18] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:13:38] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:13:43] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:52] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:38] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:13:58] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:02] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:12] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:13:58] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:17] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:22] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:31] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:17] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:36] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:41] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:52] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:36] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:14:57] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:15:02] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:15:11] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:14:57] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:15:16] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:15:20] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:15:30] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:15:16] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:15:40] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:15:48] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:05] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:15:40] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:10] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:15] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:25] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:10] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:30] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:35] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:44] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:30] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:49] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:16:53] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:03] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:16:49] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:08] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:13] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:23] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:08] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:33] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:45] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:52] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:17:56] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:09] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:17:52] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:18:19] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:18:24] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:34] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:19] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:18:39] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:18:44] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:53] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:39] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:18:58] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:19:03] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:19:19] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:18:58] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:19:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:19:39] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:19:49] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:19:29] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:19:54] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:19:58] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:20:07] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:19:54] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:20:13] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:20:20] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:20:27] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:20:13] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:20:32] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:20:32] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:20:50] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:20:50] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:21:11] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:21:11] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:21:31] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:21:31] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:21:51] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:21:51] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:13] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:38] Restarting service 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'
[Logs]    [2020-4-8 12:22:13] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:33] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs]    [2020-4-8 12:22:38] Service exited 'main sha256:454c5b68bd40a5764fea9e90b69b61c8257a8228b73e18277e2636bfda150afa'

Hey, given the errors above, it looks like there’s a problem with all of your line endings. Bash and linux in general only work with \n endings, but it looks like maybe the balena-run.sh scripts have windows line endings. The CLI has even noticed this, and recommended that you pass in --convert-eol. I would give this a try, and that should solve your issues.

Excuse my ignorance, but how do I excactly apply --convert-eol? It doesn’t appear to be a valid option in the balena push command.

Hey, you only need to append --convert-eol to your balena push command. If you do balena push --help you’ll see the docs for it.

I put --convert-eol in the wrong place in the push command, so that works now.

All seemed to be OK except that on the Train Departure Display project, it isn’t displaying anything now. I can flash the LED from the Dashboard so it appears to be running.

Hi there.

I’ve asked one of the balenaLabs team who has the hardware available to give local mode a try and see if they can replicate your issue. Unfortunately due to the late hour in Europe (where most of our labs team is located) you will probably not receive an update from them until tomorrow.

Thanks for your patience,
James.

@Nigel I think this is going to be due to the fact that when you run in local mode the environment variables required by the project are not set. Local mode takes the device out of the context of the dashboard so the variables set there will no longer apply.

To set these on the command line you’ll need to do something like: balena push 10.19.0.166 --env departureStation="EXD" --env transportApi_apiKey="ccfc416deadbeef85e209" --env transportApi_appId="3deadbeef5" --env transportApi_operatingHours="8-23" --env outOfHoursName="Exeter St. Davids" --env refreshTime=180

Keep us posted with how you get on.

Well, I set local mode in the dashboard and rebuilt the project which appeared to be successful. When I try to do the push comand it says I’m not in local mode:

PS C:\balena\train-display> balena push --convert-eol 192.168.1.24 Train_Display [Info] Starting build for Train_Display, user g_dogastus
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1598995/devices
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[main] Step 1/10 : FROM balenalib/raspberry-pi-debian-python:3.7-buster-build
[main] —> 085d49fd9286
[main] Step 2/10 : RUN install_packages jq moreutils libopenjp2-7 libfreetype6-dev libjpeg-dev libtiff5
[main] Using cache
[main] —> 3c71c8dc7149
[main] Step 3/10 : WORKDIR /usr/app
[main] Using cache
[main] —> 7b6e882a9388
[main] Step 4/10 : COPY ./requirements.txt .
[main] Using cache
[main] —> e5f613ba9364
[main] Step 5/10 : RUN pip install -r requirements.txt
[main] Using cache
[main] —> 2ac83b6f5253
[main] Step 6/10 : COPY src ./src
[main] Using cache
[main] —> 95c8be2a5682
[main] Step 7/10 : COPY balena-run.sh ./
[main] Using cache
[main] —> c5d4a76c9069
[main] Step 8/10 : COPY config.sample.json ./
[main] Using cache
[main] —> 08a3cb3e95d1
[main] Step 9/10 : RUN chmod +x balena-run.sh
[main] Using cache
[main] —> 9e89ba005678
[main] Step 10/10 : CMD ./balena-run.sh
[main] Using cache
[main] —> fb170b2952fa
[main] Successfully built fb170b2952fa
[Info] Uploading images
[Success] Successfully uploaded images
[Info] Built on arm03
[Success] Release successfully created!
[Info] Release: 78286b1db32a0b2b09b1b49e888af99c (id: 1335547)
[Info] ┌─────────┬────────────┬────────────┐
[Info] │ Service │ Image Size │ Build Time │
[Info] ├─────────┼────────────┼────────────┤
[Info] │ main │ 766.68 MB │ < 1 second │
[Info] └─────────┴────────────┴────────────┘
[Info] Build finished in 32 seconds


\
\
>/7
.-(6’
(=
./\ ) \ | / / | / > / j < _\ _.-' : ``. \ r=._\ .
<\\_ \ .-.
\ r-7 -. ._ ' .
`, -.7 7) )
/ | ’ / `-.

|| .’
\ (
>\ >
,.-’ >.’
<.’_.’’
<’
PS C:\balena\train-display> balena push --convert-eol 192.168.1.24 Train_Display --env departureStation=“NBY” --env transportApi_apiKey=“377e262eca9584978f0018b2237b83b8” --env transportApi_appId="

ebb5794d" --env transportApi_operatingHours=“7-23” --env outOfHoursName=“Newbury” --env refreshTime=180
The --env flag is only valid when pushing to a local mode device.

Hi, are you running a development version of BalenaOS on the device? And what’s the version of BalenaOS you are using?

Yes, it’s version 2.46.1+rev1

And what’s the output of a balena scan in your local network? Do you see the device as a .local host?

Yes, see below:

host: 9b3e197.local
address: 192.168.1.24
dockerInfo:
Containers: 1
ContainersRunning: 1
ContainersPaused: 0
ContainersStopped: 0
Images: 4
Driver: aufs
SystemTime: 2020-04-09T17:37:19.158673974Z
KernelVersion: 4.19.71
OperatingSystem: balenaOS 2.46.1+rev1
Architecture: armv6l
dockerVersion:
Version: 18.09.10-dev
ApiVersion: 1.39

Hi @Nigel,

This looks like the build is still going to the builders, which is odd because you’ve specific a local IP addres:

PS C:\balena\train-display> balena push --convert-eol 192.168.1.24 Train_Display [Info] Starting build for Train_Display, user g_dogastus
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1598995/devices
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images

What confuses me here is that the balena CLI shouldn’t actually be doing anything because the first argument for balena push should be the device or application name:

$ balena push --convert-eol 192.168.0.23
Missing applicationOrDevice

The correct argument placement is to send switches after the device name/IP or application name:

balena push 192.168.1.24 --convert-eol

Could you please try it this way round and let us see the output?

Best regards,

Heds

Tried that, it looks like it’s not picking up the --convert-eol:

PS C:\balena\train-display> balena push 192.168.1.24 --convert-eol Train_Display --env departureStation=“NBY” --env transportApi_apiKey=“377e262eca9584978f0018b2237b83b8” --env transportApi_appId="

ebb5794d" --env transportApi_operatingHours=“7-23” --env outOfHoursName=“Newbury” --env refreshTime=180 [Info] Starting build on device 192.168.1.24
[Info] No “docker-compose.yml” file found at “.”
[Info] Creating default composition with source: “.”
[Build] [main] Step 1/12 : FROM balenalib/raspberry-pi-debian-python:3.7-buster-build
[Build] [main] —> 31b9693234ae
[Build] [main] Step 2/12 : RUN install_packages jq moreutils libopenjp2-7 libfreetype6-dev libjpeg-dev libtiff5
[Build] [main] —> Running in 1dde00b5a81f
[Build] [main] Reading package lists…
[Build] [main] Building dependency tree…
[Build] [main] Reading state information…
[Build] [main] libjpeg-dev is already the newest version (1:1.5.2-2).
[Build] libopenjp2-7 is already the newest version (2.3.0-2+deb10u1).
[Build] libopenjp2-7 set to manually installed.
[Build] libtiff5 is already the newest version (4.1.0+git191117-2~deb10u1).
[Build] libtiff5 set to manually installed.
[Build] The following additional packages will be installed:
[Build] [main] libio-pty-perl libipc-run-perl libjq1 libonig5 libpng-dev
[Build] [main] Suggested packages:
[Build] [main] freetype2-doc libtime-duration-perl libtimedate-perl
[Build] [main] Recommended packages:
[Build] libpng-tools
[Build] [main] The following NEW packages will be installed:
[Build] [main] jq libfreetype6-dev libio-pty-perl libipc-run-perl libjq1 libonig5
[Build] [main] libpng-dev moreutils
[Build] [main] 0 upgraded, 8 newly installed, 0 to remove and 5 not upgraded.
[Build] Need to get 1292 kB of archives.
[Build] After this operation, 4275 kB of additional disk space will be used.
[Build] Get:1 http://archive.raspbian.org/raspbian buster/main armhf libonig5 armhf 6.9.1-1 [150 kB]
[Build] [main] Get:2 http://archive.raspbian.org/raspbian buster/main armhf libjq1 armhf 1.5+dfsg-2+b1 [119 kB]
[Build] [main] Get:3 http://archive.raspbian.org/raspbian buster/main armhf jq armhf 1.5+dfsg-2+b1 [59.3 kB]
[Build] [main] Get:4 http://archive.raspbian.org/raspbian buster/main armhf libpng-dev armhf 1.6.36-6 [281 kB]
[Build] [main] Get:5 http://archive.raspbian.org/raspbian buster/main armhf libfreetype6-dev armhf 2.9.1-3+deb10u1 [479 kB]
[Build] [main] Get:6 http://archive.raspbian.org/raspbian buster/main armhf libio-pty-perl armhf 1:1.08-1.1+b4 [33.0 kB]
[Build] [main] Get:7 http://archive.raspbian.org/raspbian buster/main armhf libipc-run-perl all 20180523.0-1 [101 kB]
[Build] [main] Get:8 http://archive.raspbian.org/raspbian buster/main armhf moreutils armhf 0.62-1+b1 [69.3 kB]
[Build] [main] debconf: delaying package configuration, since apt-utils is not installed
[Build]
[Build] [main] Fetched 1292 kB in 1s (1458 kB/s)
[Build] [main] Selecting previously unselected package libonig5:armhf.
[Build] [main] (Reading database …
[Build] [main] (Reading database … 5%
[Build] [main] (Reading database … 10%
[Build] [main] (Reading database … 15%
[Build] [main] (Reading database … 20%
[Build] [main] (Reading database … 25%
[Build] [main] (Reading database … 30%
[Build] [main] (Reading database … 35%
[Build] [main] (Reading database … 40%
[Build] [main] (Reading database … 45%
(Reading database … 65% database … 50%
(Reading database … 20403 files and directories currently installed.)
[Build] [main] Preparing to unpack …/0-libonig5_6.9.1-1_armhf.deb …
[Build] [main] Unpacking libonig5:armhf (6.9.1-1) …
[Build] [main] Selecting previously unselected package libjq1:armhf.
[Build] [main] Preparing to unpack …/1-libjq1_1.5+dfsg-2+b1_armhf.deb …
[Build] [main] Unpacking libjq1:armhf (1.5+dfsg-2+b1) …
[Build] [main] Selecting previously unselected package jq.
[Build] [main] Preparing to unpack …/2-jq_1.5+dfsg-2+b1_armhf.deb …
[Build] [main] Unpacking jq (1.5+dfsg-2+b1) …
[Build] [main] Selecting previously unselected package libpng-dev:armhf.
[Build] [main] Preparing to unpack …/3-libpng-dev_1.6.36-6_armhf.deb …
[Build] [main] Unpacking libpng-dev:armhf (1.6.36-6) …
[Build] [main] Selecting previously unselected package libfreetype6-dev:armhf.
[Build] [main] Preparing to unpack …/4-libfreetype6-dev_2.9.1-3+deb10u1_armhf.deb …
[Build] [main] Unpacking libfreetype6-dev:armhf (2.9.1-3+deb10u1) …
[Build] [main] Selecting previously unselected package libio-pty-perl.
[Build] [main] Preparing to unpack …/5-libio-pty-perl_1%3a1.08-1.1+b4_armhf.deb …
[Build] [main] Unpacking libio-pty-perl (1:1.08-1.1+b4) …
[Build] [main] Selecting previously unselected package libipc-run-perl.
[Build] [main] Preparing to unpack …/6-libipc-run-perl_20180523.0-1_all.deb …
[Build] [main] Unpacking libipc-run-perl (20180523.0-1) …
[Build] [main] Selecting previously unselected package moreutils.
[Build] [main] Preparing to unpack …/7-moreutils_0.62-1+b1_armhf.deb …
[Build] [main] Unpacking moreutils (0.62-1+b1) …
[Build] [main] Setting up libio-pty-perl (1:1.08-1.1+b4) …
[Build] [main] Setting up libpng-dev:armhf (1.6.36-6) …
[Build] [main] Setting up libfreetype6-dev:armhf (2.9.1-3+deb10u1) …
[Build] [main] Setting up libipc-run-perl (20180523.0-1) …
[Build] [main] Setting up libonig5:armhf (6.9.1-1) …
[Build] [main] Setting up moreutils (0.62-1+b1) …
[Build] [main] Setting up libjq1:armhf (1.5+dfsg-2+b1) …
[Build] [main] Setting up jq (1.5+dfsg-2+b1) …
[Build] [main] Processing triggers for libc-bin (2.28-10+rpi1) …
[Build] [main] Removing intermediate container 1dde00b5a81f
[Build] [main] —> 2c510d2236f7
[Build] [main] Step 3/12 : WORKDIR /usr/app
[Build] [main] —> Running in 730260ae7474
[Build] [main] Removing intermediate container 730260ae7474
[Build] [main] —> 7a11ca2159db
[Build] [main] Step 4/12 : COPY ./requirements.txt .
[Build] [main] —> e84bf2914361
[Build] [main] Step 5/12 : RUN pip install -r requirements.txt
[Build] [main] —> Running in bbce11daee84
[Build] [main] Collecting luma.oled
[Build] [main] Downloading https://files.pythonhosted.org/packages/b0/fa/ef1065ad3644608d6127ce05da43b2b6ab1857b5b26983439f696bab6f4a/luma.oled-3.4.0-py2.py3-none-any.whl
[Build] [main] Collecting timeloop
[Build] [main] Downloading https://files.pythonhosted.org/packages/6a/95/3e39ee32f15a8e9dea46bb52300611a5351964eeaa393bafb0d738e90ce0/timeloop-1.0.2.tar.gz
[Build] [main] Collecting requests
[Build] [main] Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
[Build] [main] Collecting luma.core>=1.12.0
[Build] [main] Downloading https://files.pythonhosted.org/packages/90/51/ae30ce7c3ef0698547b77cb3263f17f49345f33e360af8032f86c0f6dcf6/luma.core-1.14.0-py2.py3-none-any.whl (51kB)
[Build] [main] Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
[Build] [main] Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
[Build] [main] Collecting certifi>=2017.4.17
[Build] [main] Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
[Build] [main] Collecting idna<3,>=2.5
[Build] [main] Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
[Build] [main] Collecting chardet<4,>=3.0.2
[Build] [main] Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
[Build] [main] Collecting pyftdi
[Build] [main] Downloading https://files.pythonhosted.org/packages/ee/7c/7b6c705b60159806c073e5539a233813f10b1c0c9a11a824b1a27ddddaad/pyftdi-0.50.0-py36-none-any.whl (148kB)
[Build] [main] Collecting pillow>=4.0.0
[Build] [main] Downloading https://files.pythonhosted.org/packages/c7/04/c91bb0e495c1e8a09633ecb061fab32e276ace7cefcef5d12334cdd14cd2/Pillow-7.1.1.tar.gz (38.9MB)
[Build] [main] Collecting RPI.GPIO; platform_system == “Linux”
[Build] [main] Downloading https://files.pythonhosted.org/packages/cb/88/d3817eb11fc77a8d9a63abeab8fe303266b1e3b85e2952238f0da43fed4e/RPi.GPIO-0.7.0.tar.gz
[Build] [main] Collecting spidev; platform_system == “Linux”
[Build] [main] Downloading https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz
[Build] [main] Collecting smbus2
[Build] [main] Downloading https://files.pythonhosted.org/packages/6a/06/80a6928e5cbfd40c77c08e06ae9975c2a50109586ce66435bd8166ce6bb3/smbus2-0.3.0.tar.gz
[Build] [main] Collecting pyusb>=1.0.0
[Build] [main] Downloading https://files.pythonhosted.org/packages/5f/34/2095e821c01225377dda4ebdbd53d8316d6abb243c9bee43d3888fa91dd6/pyusb-1.0.2.tar.gz (54kB)
[Build] [main] Collecting pyserial>=3.0
[Build] [main] Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193kB)
[Build] [main] Installing collected packages: pyusb, pyserial, pyftdi, pillow, RPI.GPIO, spidev, smbus2, luma.core, luma.oled, timeloop, urllib3, certifi, idna, chardet, requests
[Build] [main] Running setup.py install for pyusb: started
[Build] [main] Running setup.py install for pyusb: finished with status ‘done’
[Build] [main] Running setup.py install for pillow: started
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: still running…
[Build] [main] Running setup.py install for pillow: finished with status ‘done’
[Build] [main] Running setup.py install for RPI.GPIO: started
[Build] [main] Running setup.py install for RPI.GPIO: finished with status ‘done’
[Build] [main] Running setup.py install for spidev: started
[Build] [main] Running setup.py install for spidev: finished with status ‘done’
[Build] [main] Running setup.py install for smbus2: started
[Build] [main] Running setup.py install for smbus2: finished with status ‘done’
[Build] [main] Running setup.py install for timeloop: started
[Build] [main] Running setup.py install for timeloop: finished with status ‘done’
[Build] [main] Successfully installed RPI.GPIO-0.7.0 certifi-2020.4.5.1 chardet-3.0.4 idna-2.9 luma.core-1.14.0 luma.oled-3.4.0 pillow-7.1.1 pyftdi-0.50.0 pyserial-3.4 pyusb-1.0.2 requests-2.23.0 smbus2-0.3.0 spidev-3.4 timeloop-1.0.2 urllib3-1.25.8
[Build] [main] WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
[Build] You should consider upgrading via the ‘pip install --upgrade pip’ command.
[Build]
[Build] [main] Removing intermediate container bbce11daee84
[Build] [main] —> 1cddab77a12f
[Build] [main] Step 6/12 : COPY src ./src
[Build] [main] —> 3d9067e40d64
[Build] [main] Step 7/12 : COPY balena-run.sh ./
[Build] [main] —> eba067074893
[Build] [main] Step 8/12 : COPY config.sample.json ./
[Build] [main] —> cba3267718f9
[Build] [main] Step 9/12 : RUN chmod +x balena-run.sh
[Build] [main] —> Running in bba2d3e50026
[Build] [main] Removing intermediate container bba2d3e50026
[Build] [main] —> 9ac1567db877
[Build] [main] Step 10/12 : CMD ./balena-run.sh
[Build] [main] —> Running in a0d03a4a9972
[Build] [main] Removing intermediate container a0d03a4a9972
[Build] [main] —> ab597b7e98c3
[Build] [main] Step 11/12 : LABEL io.resin.local.image=1
[Build] [main] —> Running in 03a1c5ec4697
[Build] [main] Removing intermediate container 03a1c5ec4697
[Build] [main] —> 9147891c06a4
[Build] [main] Step 12/12 : LABEL io.resin.local.service=main
[Build] [main] —> Running in f096a9de64ac
[Build] [main] Removing intermediate container f096a9de64ac
[Build] [main] —> 6ba2255341e5
[Build] [main] Successfully built 6ba2255341e5
[Build] [main] Successfully tagged local_image_main:latest

[Live] Waiting for device state to settle…
[Info] Streaming device logs…
[Live] Watching for file changes…
[Logs] [2020-4-10 10:26:54] Creating network ‘default’
[Logs] [2020-4-10 10:26:54] Creating volume ‘resin-data’
[Logs] [2020-4-10 10:26:55] Installing service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:26:58] Installed service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:26:58] Starting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:27:07] Started service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:27:03] [main] jq: error: syntax error, unexpected $end (Unix shell quoting issues?) at , line 1:
[Logs] [2020-4-10 10:27:03] [main] .refreshTime=
[Logs] [2020-4-10 10:27:03] [main] jq: 1 compile error
[Logs] [2020-4-10 10:27:17] [main] Error: Expecting value: line 1 column 1 (char 0)
[Live] Device state settled
[Logs] [2020-4-10 10:27:35] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:27:36] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:27:17] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:27:44] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:27:54] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:13] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:27:44] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:28:15] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:28:21] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:31] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:15] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:28:35] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:28:41] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:50] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:35] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:28:54] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:00] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:10] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:28:54] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:14] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:21] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:30] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:14] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:33] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:40] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:49] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:33] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:52] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:29:59] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:30:08] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 10:29:52] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:30:11] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 10:30:18] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’

@Nigel, I was able to reproduce the error. What I found was:

  • A refreshTime environment variable is missing on the command line, which causes “Error: Expecting value: line 1 column 1 (char 0)” in the balena-run.sh script: https://github.com/balenalabs/uk-train-departure-display/blob/master/balena-run.sh#L8
  • Perhaps the most convenient option for local push would be to rename the project’s config.sample.json file to config.json and edit the file to add the values there, instead of setting environment variables on the command line. The project’s config.sample.json file is at the root of the git repository that was cloned: https://github.com/balenalabs/uk-train-departure-display/blob/master/config.sample.json
  • I’ve also noticed a couple of further issues on the command line:
    • The Train_Display argument should not be there. If you meant it as the application name, simply remove it because the IP address replaces the application name when pushing to a local device. But if you meant it as a folder name that contains the project root, then it should be --source Train_Display. (If the project root is the current working directory, then simply remove Train_Display.
    • The --convert-eol option does not take an argument, so it’s probably better to pass it last (not sure it really matters in this case).

Given the above, if you rename config.sample.json to config.json and edit it, then the command line would become:

PS C:\balena\train-display> balena push 192.168.1.24 --convert-eol

But if you wanted to keep using environment variables on the command line instead of using the config.json file, then the command line should include refreshTime:

PS C:\balena\train-display> balena push 192.168.1.24 --env departureStation="NBY" --env transportApi_apiKey="377..." --env transportApi_appId="ebb..." --env transportApi_operatingHours="7-23" --env outOfHoursName="Newbury" --env refreshTime=180 --convert-eol

NB. The project’s config.json file has nothing to do with the device’s config.json file located in the balenaOS boot partition! The project’s config.json file would be where the uk-train-departure-display github repo was cloned, for example C:\balena\train-display\config.json. In a running device, the project’s config file is located at /usr/app/config.json.

Oh, a colleague pointed out that your command line actually included the refreshTime variable and others. I missed them with the broken formatting (copy and paste issue?) Still, the error is most likely coming from some of the jq lines in the balena-run.sh script, so try renaming the config.sample.json file and using it as suggested, and let us know if it works.

@pdcastro Thank you very much for your extensive reply, most appreciated. I’ll give it all a try and report back.

Nigel.

I tried both methods but they resulted in the same failure:

[Logs] [2020-4-10 16:20:32] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 16:20:10] [main] Error: Expecting value: line 1 column 1 (char 0)

I assume the error relates the the main.py file.

I don’t understand the need for the --convert-eol as the .py files seem to have Unix style end of lines already.

@Nigel, in one of my attempts I also got the JSON parsing error (Expecting value: line 1 column 1 (char 0)) printed in the output of balena push even when using the config.json file, but what had happened is that the old container was still running on the device and for some reason wasn’t automatically restarted. Just in case, you can try manually deleting the container from the device with the commands:

PS C:\Users\paulo> ssh -p 22222 root@192.168.1.24
Last login: Fri Apr 10 15:44:08 2020

root@dcbff32:~# balena-engine ps -a
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                 PORTS               NAMES
73c2a3c1fdab        f677c154b90f                         "/usr/bin/entry.sh /…"   4 minutes ago       Up 4 minutes                               main_1_1
efd626c932f2        balena/aarch64-supervisor:v10.6.27   "./entry.sh"             2 months ago        Up 5 hours (healthy)                       resin_supervisor

root@dcbff32:~# balena-engine rm -f main_1_1
main_1_1

root@dcbff32:~# balena-engine ps -a
CONTAINER ID        IMAGE                                COMMAND             CREATED             STATUS                 PORTS               NAMES
efd626c932f2        balena/aarch64-supervisor:v10.6.27   "./entry.sh"        2 months ago        Up 5 hours (healthy)                       resin_supervisor

The key command being: balena-engine rm -f main_1_1
(The device should be in local mode.)

And then run the balena push command line again.

I assume the error relates the the main.py file

Perhaps. There is a loadConfig function at https://github.com/balenalabs/uk-train-departure-display/blob/master/src/main.py#L21-L24
You can try adding a print message there, to see if the error is printed before or after that point, for example the following print line:

def loadConfig():

    print("about to load the config.json file...")

    with open('config.json', 'r') as jsonConfig:
        data = json.load(jsonConfig)
        return data

You can also add debugging echo lines in the balena-run.sh, for example the following 3 added echo lines:

#!/bin/bash

echo "entering balena-run.sh ..."

if [ ! -f config.json ]; then

  echo "copying config.sample.json ..."

  cp config.sample.json config.json
  jq .journey.departureStation=\""${departureStation}"\" config.json | sponge config.json
  jq .journey.destinationStation=\""${destinationStation}"\" config.json | sponge config.json
  jq .journey.outOfHoursName=\""${outOfHoursName}"\" config.json | sponge config.json
  jq .refreshTime="${refreshTime}" config.json | sponge config.json
  jq .transportApi.appId=\""${transportApi_appId}"\" config.json | sponge config.json
  jq .transportApi.apiKey=\""${transportApi_apiKey}"\" config.json | sponge config.json
  jq .transportApi.operatingHours=\""${transportApi_operatingHours}"\" config.json | sponge config.json
fi

echo "got past if statement..."

python ./src/main.py

I don’t understand the need for the --convert-eol […]

It may not be needed. It is only useful / relevant if your Windows text editor is saving files with CRLF line ending, especially shell scripts like balena-run.sh which fail to run on Linux with CRLF characters. On Windows, Visual Studio Code gives you the option of choosing what line ending to use, and it will preserve Linux line ending by default.

@pdcastro

OK, I managed to make it work despite the error messages with the long command line option:

PS C:\balena\train-display> balena push 192.168.1.24 --env departureStation=“PAD” --env transportApi_apiKey=“377e262eca9584978f0018b2237b83b8” --env transportApi_appId=“ebb5794d” --env transportApi_operatingHours=“7-23” --env outOfHoursName=“Newbury” --env refreshTime=180 --convert-eol

[Info] Starting build on device 192.168.1.24
[Info] No “docker-compose.yml” file found at “.”
[Info] Creating default composition with source: “.”
[Build] [main] Step 1/12 : FROM balenalib/raspberry-pi-debian-python:3.7-buster-build
[Build] [main] —> 31b9693234ae
[Build] [main] Step 2/12 : RUN install_packages jq moreutils libopenjp2-7 libfreetype6-dev libjpeg-dev libtiff5
[Build] [main] —> Using cache
[Build] [main] —> 2c510d2236f7
[Build] [main] Step 3/12 : WORKDIR /usr/app
[Build] [main] —> Using cache
[Build] [main] —> 7a11ca2159db
[Build] [main] Step 4/12 : COPY ./requirements.txt .
[Build] [main] —> Using cache
[Build] [main] —> e84bf2914361
[Build] [main] Step 5/12 : RUN pip install -r requirements.txt
[Build] [main] —> Using cache
[Build] [main] —> 1cddab77a12f
[Build] [main] Step 6/12 : COPY src ./src
[Build] [main] —> Using cache
[Build] [main] —> 3d9067e40d64
[Build] [main] Step 7/12 : COPY balena-run.sh ./
[Build] [main] —> Using cache
[Build] [main] —> eba067074893
[Build] [main] Step 8/12 : COPY config.sample.json ./
[Build] [main] —> Using cache
[Build] [main] —> cba3267718f9
[Build] [main] Step 9/12 : RUN chmod +x balena-run.sh
[Build] [main] —> Using cache
[Build] [main] —> 9ac1567db877
[Build] [main] Step 10/12 : CMD ./balena-run.sh
[Build] [main] —> Using cache
[Build] [main] —> ab597b7e98c3
[Build] [main] Step 11/12 : LABEL io.resin.local.image=1
[Build] [main] —> Using cache
[Build] [main] —> 9147891c06a4
[Build] [main] Step 12/12 : LABEL io.resin.local.service=main
[Build] [main] —> Using cache
[Build] [main] —> 6ba2255341e5
[Build] [main] Successfully built 6ba2255341e5
[Build] [main] Successfully tagged local_image_main:latest

[Live] Waiting for device state to settle…
[Info] Streaming device logs…
[Live] Watching for file changes…
[Logs] [2020-4-10 17:05:31] Restarting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:10] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 17:05:35] Killing service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:41] [main] Error: Expecting value: line 1 column 1 (char 0)
[Logs] [2020-4-10 17:05:51] Service exited ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:51] Killed service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:57] Installing service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:58] Installed service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:05:58] Starting service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Logs] [2020-4-10 17:06:07] Started service ‘main sha256:6ba2255341e528d519fed7a298c46eadee6eb5b029468fee105c7a1b82c7743b’
[Live] Device state settled
[Logs] [2020-4-10 17:06:15] [main] /usr/local/lib/python3.7/site-packages/luma/core/interface/serial.py:185: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
[Logs] [2020-4-10 17:06:15] [main] self._gpio.setup(pin, self._gpio.OUT)

I will study what you have suggested and see if I can get rid of the error messages.