Open DominoLeChat opened 1 month ago
Hey, thanks for trying FrameOS! Curious to hear what's your use case and/or if you have any feedback for the system as it is.
Regarding this issue, it seems like I had a broken migration. This should be fixed now, and you can try it out when the new docker image lands.
The new Docker image appears to be working, thank you very much !
I built two little picture frames, each one containing a 7.5inch 640x384 3 colors (black, white and red) e-ink screen, one using a ESP32 running ESPHome to show the music currently playing on my speakers, and the second one using a Raspberry Pi Zero 2W to show a random image every day. I was running Inkycal on the Raspberry Pi previously, but the software doesn't support generating images via AI, and doesn't support landscape mode, only portrait.
I'm however running into another issue, the scenes refuses to deploy on the Raspberry Pi with the error "Low memory detected". I tried resizing the swap file to 2Gb and expanding the SD Card partitions, but it still refuses to deploy...
2024-05-09 15:22:03
Deploying frame salon with build id qkipcgnalglt
2024-05-09 15:22:03
Connecting via SSH to clement@192.168.0.51 (password)
2024-05-09 15:22:03
Connected via SSH to clement@192.168.0.51
2024-05-09 15:22:03
- Getting target architecture
2024-05-09 15:22:03
> uname -m
2024-05-09 15:22:04
aarch64
2024-05-09 15:22:04
> free -m
2024-05-09 15:22:04
total used free shared buff/cache available
2024-05-09 15:22:04
Mem: 417 125 216 0 124 291
2024-05-09 15:22:04
Swap: 99 0 99
2024-05-09 15:22:04
- Copying build folders
2024-05-09 15:22:04
- Applying local modifications
2024-05-09 15:22:04
- Creating build archive
2024-05-09 15:22:04
- No cross compilation. Generating source code for compilation on frame.
2024-05-09 15:22:04
$ cd /tmp/tmpd5knmx6e/frameos && nimble assets -y && nimble setup && nim compile --os:linux --cpu:arm64 --compileOnly --genScript --nimcache:/tmp/tmpd5knmx6e/build_qkipcgnalglt src/frameos.nim 2>&1
2024-05-09 15:22:05
Downloading https://github.com/wltsmrz/nim_zstd using git
2024-05-09 15:22:07
Installing zstd@0.9.0
2024-05-09 15:22:07
Success: zstd installed successfully.
2024-05-09 15:22:08
Downloading https://github.com/xmonader/nimassets using git
2024-05-09 15:22:10
Installing nimassets@0.2.4
2024-05-09 15:22:10
Building nimassets/nimassets using c backend
2024-05-09 15:22:47
Success: nimassets installed successfully.
2024-05-09 15:22:56
Executing task assets in /tmp/tmpd5knmx6e/frameos/frameos.nimble
2024-05-09 15:22:57
assets/web/index.html ... ok
2024-05-09 15:22:57
assets/web/control.html ... ok
2024-05-09 15:22:57
assets/fonts/Ubuntu-Regular_1.ttf ... ok
2024-05-09 15:22:57
Info: "nimble.paths" is updated.
2024-05-09 15:22:57
Info: "config.nims" is already set up.
2024-05-09 15:22:58
Hint: used config file '/opt/nim/config/nim.cfg' [Conf]
2024-05-09 15:22:58
Hint: used config file '/opt/nim/config/config.nims' [Conf]
2024-05-09 15:22:58
Hint: used config file '/tmp/tmpd5knmx6e/frameos/nim.cfg' [Conf]
2024-05-09 15:22:58
Hint: used config file '/tmp/tmpd5knmx6e/frameos/config.nims' [Conf]
2024-05-09 15:23:02
...................................................................................................................................................................................................................................................
2024-05-09 15:23:02
/tmp/tmpd5knmx6e/frameos/src/lib/httpclient.nim(345, 35) Hint: 'code' cannot raise 'OverflowDefect' [XCannotRaiseY]
2024-05-09 15:23:03
/tmp/tmpd5knmx6e/frameos/src/lib/httpclient.nim(345, 35) Hint: 'code' cannot raise 'OverflowDefect' [XCannotRaiseY]
2024-05-09 15:23:03
/opt/nim/lib/pure/asyncmacro.nim(361, 14) Hint: 'await' is declared but not used [XDeclaredButNotUsed]
2024-05-09 15:23:04
...........................
2024-05-09 15:23:04
/root/.nimble/pkgs2/jester-0.6.0-a5120cfff525e23be29bb2ff47b6ba2f4b2674a3/jester.nim(1346, 9) Hint: Asynchronous route: myrouter. [User]
2024-05-09 15:23:04
/root/.nimble/pkgs2/jester-0.6.0-a5120cfff525e23be29bb2ff47b6ba2f4b2674a3/jester.nim(866, 9) Hint: 'settings' is declared but not used [XDeclaredButNotUsed]
2024-05-09 15:23:04
/tmp/tmpd5knmx6e/frameos/src/frameos/frameos.nim(1, 36) Warning: imported and not used: 'chroma' [UnusedImport]
2024-05-09 15:23:05
Hint: mm: orc; threads: on; opt: speed; options: -d:release
2024-05-09 15:23:05
127329 lines; 7.258s; 397.184MiB peakmem; proj: /tmp/tmpd5knmx6e/frameos/src/frameos.nim; out: /tmp/tmpd5knmx6e/build_qkipcgnalglt/frameos.json [SuccessX]
2024-05-09 15:23:05
[1m/tmp/nimble_47/githubcom_xmonadernimassets_0.2.4_d06724dd7b80fb470542ab932f3a94af78fe2eb1/src/nimassets.nim(3, 8) [0m[33mWarning: [0muse the nimble packages `malebolgia`, `taskpools` or `weave` instead; threadpool is deprecated[36m [Deprecated][0m[0m
2024-05-09 15:23:06
- Low memory detected, stopping FrameOS for compilation
2024-05-09 15:23:06
> sudo service frameos stop
2024-05-09 15:23:10
Failed to stop frameos.service: Unit frameos.service not loaded.
2024-05-09 15:23:10
Command exited with status 5
2024-05-09 15:23:10
SSH connection closed
Looks nice! If you get something running, feel free to share in this thread as well :).
Currently compilation takes place in two steps: 1) compile nim -> c, 2) compile c -> binary. The first step is performed on the controller host, the second on the raspberry. It seems like the first stage on the host controller is erroring out. Did you increase memory on the docker host or the device?
Coincidentally I've been exploring memory issues these last days, as my two Raspberry Pi Zero W2-s sometimes crash and need a hard reset. I patched a hole with open file descriptors earlier, but there's still something up with the logger, which will take another few days to patch.
I've noticed that when I run other stuff on the raspberry at the same time (e.g. netdata for monitoring), compilation often fails... however it has always succeeded when I have 400+MB available on the raspberry, with swap disabled. I have however not measured how much RAM is needed on the host.
Thanks ! I will publish the final result in the thread ! I tried running the controller part on two different servers, one with 8Gb of RAM and another with 16Gb of RAM, and I still get the error "Low memory detected, stopping FrameOS for compilation". I also tried reformatting the SD Card and reinstalling the OS (Raspberry Pi OS Lite 64-bit), on a 64Gb micro SD, but still the same result. I see that the container is using around 600mb of RAM, and the log says "No cross compilation. Generating source code for compilation on frame". Would it be possible maybe to force compilation on the host rather than on the raspberry ?
Here's the log on the second machine :
2024-05-09 16:53:24
[1m/tmp/nimble_42/githubcom_xmonadernimassets_0.2.4_d06724dd7b80fb470542ab932f3a94af78fe2eb1/src/nimassets.nim(3, 8) [0m[33mWarning: [0muse the nimble packages `malebolgia`, `taskpools` or `weave` instead; threadpool is deprecated[36m [Deprecated][0m[0m
2024-05-09 16:53:25
- Low memory detected, stopping FrameOS for compilation
2024-05-09 16:53:25
> sudo service frameos stop
2024-05-09 16:53:28
Failed to stop frameos.service: Unit frameos.service not loaded.
2024-05-09 16:53:28
Command exited with status 5
2024-05-09 16:53:28
SSH connection closed
2024-05-09 16:53:56
Deploying frame salon with build id uomxhwbrsmgs
2024-05-09 16:53:56
Connecting via SSH to clement@192.168.0.51 (password)
2024-05-09 16:53:56
Connected via SSH to clement@192.168.0.51
2024-05-09 16:53:56
- Getting target architecture
2024-05-09 16:53:56
> uname -m
2024-05-09 16:53:57
aarch64
2024-05-09 16:53:57
> free -m
2024-05-09 16:53:57
total used free shared buff/cache available
2024-05-09 16:53:57
Mem: 417 125 223 0 118 291
2024-05-09 16:53:57
Swap: 2047 0 2047
2024-05-09 16:53:57
- Copying build folders
2024-05-09 16:53:57
- Applying local modifications
2024-05-09 16:53:57
- Creating build archive
2024-05-09 16:53:57
- No cross compilation. Generating source code for compilation on frame.
2024-05-09 16:53:57
$ cd /tmp/tmp6ipneiga/frameos && nimble assets -y && nimble setup && nim compile --os:linux --cpu:arm64 --compileOnly --genScript --nimcache:/tmp/tmp6ipneiga/build_uomxhwbrsmgs src/frameos.nim 2>&1
2024-05-09 16:53:58
Executing task assets in /tmp/tmp6ipneiga/frameos/frameos.nimble
2024-05-09 16:53:59
assets/web/index.html ... ok
2024-05-09 16:53:59
assets/web/control.html ... ok
2024-05-09 16:53:59
assets/fonts/Ubuntu-Regular_1.ttf ... ok
2024-05-09 16:53:59
Info: "nimble.paths" is updated.
2024-05-09 16:53:59
Info: "config.nims" is already set up.
2024-05-09 16:53:59
Hint: used config file '/opt/nim/config/nim.cfg' [Conf]
2024-05-09 16:53:59
Hint: used config file '/opt/nim/config/config.nims' [Conf]
2024-05-09 16:53:59
Hint: used config file '/tmp/tmp6ipneiga/frameos/nim.cfg' [Conf]
2024-05-09 16:53:59
Hint: used config file '/tmp/tmp6ipneiga/frameos/config.nims' [Conf]
2024-05-09 16:54:04
...................................................................................................................................................................................................................................................
2024-05-09 16:54:04
/tmp/tmp6ipneiga/frameos/src/lib/httpclient.nim(345, 35) Hint: 'code' cannot raise 'OverflowDefect' [XCannotRaiseY]
2024-05-09 16:54:04
/tmp/tmp6ipneiga/frameos/src/lib/httpclient.nim(345, 35) Hint: 'code' cannot raise 'OverflowDefect' [XCannotRaiseY]
2024-05-09 16:54:04
/opt/nim/lib/pure/asyncmacro.nim(361, 14) Hint: 'await' is declared but not used [XDeclaredButNotUsed]
2024-05-09 16:54:05
...........................
2024-05-09 16:54:05
/root/.nimble/pkgs2/jester-0.6.0-a5120cfff525e23be29bb2ff47b6ba2f4b2674a3/jester.nim(1346, 9) Hint: Asynchronous route: myrouter. [User]
2024-05-09 16:54:05
/root/.nimble/pkgs2/jester-0.6.0-a5120cfff525e23be29bb2ff47b6ba2f4b2674a3/jester.nim(866, 9) Hint: 'settings' is declared but not used [XDeclaredButNotUsed]
2024-05-09 16:54:05
/tmp/tmp6ipneiga/frameos/src/frameos/frameos.nim(1, 36) Warning: imported and not used: 'chroma' [UnusedImport]
2024-05-09 16:54:06
Hint: mm: orc; threads: on; opt: speed; options: -d:release
2024-05-09 16:54:06
127329 lines; 6.368s; 397.184MiB peakmem; proj: /tmp/tmp6ipneiga/frameos/src/frameos.nim; out: /tmp/tmp6ipneiga/build_uomxhwbrsmgs/frameos.json [SuccessX]
2024-05-09 16:54:06
- Low memory detected, stopping FrameOS for compilation
2024-05-09 16:54:06
> sudo service frameos stop
2024-05-09 16:54:10
Failed to stop frameos.service: Unit frameos.service not loaded.
2024-05-09 16:54:10
Command exited with status 5
2024-05-09 16:54:10
SSH connection closed
Oh... I'm mistaken here. I read the log wrong. The first compilation succeeded, yet we didn't even get to the second stage. The bug was this: https://github.com/FrameOS/frameos/commit/795c5da7b50aeb5886662e6c81bf12d8b81eef4e
The new docker image should be out shortly
Would it be possible maybe to force compilation on the host rather than on the raspberry ?
I'd love that, but getting the cross compilation toolchain setup isn't trivial. I did get it working once as a proof of concept, but didn't "productize" it yet. I guess stay tuned... 😅
Compiling on a Pi Zero2 is really slow though, so I'm soon past the point of frustration where I'll work on it :).
Sorry for the late reply, the new docker image works perfectly ! Thank you so much ! I also have another problem, I don't know if I have to create a new issue on Github... My display (Waveshare 7.5inch e-Paper HAT (B) V1 640x384 black/white/red) is not on the list. There is a Waveshare 7.5" 640x384 option that works, but only in black and white (no red) and a Waveshare 7.5" (BC) 640x384 black/white/yellow that doesn't work (faded image and no red). I think the driver for my display is this one : https://github.com/waveshareteam/e-Paper/blob/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd7in5bc.py. In this python code from Waveshare, the color red seems to be supported.
Your display should indeed be the "Waveshare 7.5" (BC) 640x384 black/white/yellow" version. It seems I made a slight mistake in setting them up --> there are two displays, B (red) and C (yellow), both using the same driver. I need to break them up since now it'll generate the red image, but dither it as if it was yellow, likely resulting in odd colors.
However... you report this driver also doesn't work... 🤔. Can you check if it works with the WaveShare C examples, as that's what FrameOS's waveshare drivers are based on. If it works, then FrameOS is probably sending data wrong and we need to look closer. If it doesn't, can you check if it works with waveshare's python examples. The inkycal driver seems to be a direct copy of the waveshare driver, so it probably should. If the Python version works and the C version doesn't, we need to figure out what's different between the two...
I just split up the drivers into separate B and C variants. Once that's merged and a new docker image is available, you'll need to select a new driver entry from the list. However I fear it'll be equally broken. The shown dithered image will likely show better, but if nothing appeared on your screen before, that's unlikely to change.
Hey @DominoLeChat , were you able to get it working in the end? Did the waveshare C example work?
Hi, So I just tried the "Waveshare 7.5" (B) 640x384 black/white/red" and it works ! There are sometimes white lines across the screen, but I think it's a problem with my display.
Hi ! First of all, thank you for your work ! I installed FrameOS using Docker Compose on an arm64 server running Ubuntu 24.04, and I get an error in the logs when the container starts. I can still connect on the web ui, but I can't create a new frame. I tried with Docker Run and I even tried building the image locally, but the same error appears. Here's the log :