Help with installation on Synology and ESP32 Box

Hy,
now the second questions in the forum:
I have tried to install the teddycloud on a Synology NAS with the help of this youtube video:
https://www.youtube.com/watch?v=JpMRyshgy9o

My problem is that with this docker composefile ( https://github.com/toniebox-reverse-engineering/teddycloud/blob/master/docker/docker-compose.yaml) and the removed #/Hash for the 443 Port I get following error:

Failed to deploy a stack: Network teddycloud_default Creating Network teddycloud_default Created Container teddycloud Creating Container teddycloud Created Container teddycloud Starting Error response from daemon: driver failed programming external connectivity on endpoint teddycloud (b2627078085b3f1fcb96a0d30beff41ae834037d3d9eea0e13925105c7f18c65): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use 

Because of that I commented the line out “# - 443:443 #Port is needed for the connection for the box, must not be changed!” again. And the teddy clould is running.
So it wass possible for me to get the firmware file and also to flash the new patched firmware file on the box sucessfully. My Probem is that I get the flashed box has no connetion with the teddy cloud.

Thats the log after the startup:

2024-12-29T09:15:48.060066372Z TeddyCloud v0.6.2 (203f12d) - 2024-10-26 18:14:34 +0000 ubuntu linux-x86_64(64)
2024-12-29T09:15:48.060672119Z 
2024-12-29T09:15:48.061513762Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
2024-12-29T09:15:48.062911658Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.ini
2024-12-29T09:15:48.077772211Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
2024-12-29T09:15:48.078107993Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.078932411Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
2024-12-29T09:15:48.079171927Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.101585724Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/ca.der' detected as DER style CERTIFICATE
2024-12-29T09:15:48.112063717Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/client.der' detected as DER style CERTIFICATE
2024-12-29T09:15:48.112542194Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/client/private.der' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.112704855Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
2024-12-29T09:15:48.114541913Z INFO |tls_adapter.c:0390:tls_adapter_init| Loading certificates...
2024-12-29T09:15:48.114656229Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
2024-12-29T09:15:48.114700038Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.114806045Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
2024-12-29T09:15:48.114897857Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.115020918Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/ca.der' detected as DER style CERTIFICATE
2024-12-29T09:15:48.115140264Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/client.der' detected as DER style CERTIFICATE
2024-12-29T09:15:48.115243240Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/client/private.der' detected as DER style RSA PRIVATE KEY
2024-12-29T09:15:48.127180029Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
2024-12-29T09:15:48.127422304Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5081764
2024-12-29T09:15:48.547432503Z INFO |toniesJson.c:0100:tonies_update| Updating tonies.json from api.revvox.de...
2024-12-29T09:15:48.547633405Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
2024-12-29T09:15:48.591046679Z INFO |cloud_request.c:0252:web_request|   trying IP: 157.90.183.226
2024-12-29T09:15:48.827599692Z INFO |cloud_request.c:0382:web_request| Redirecting to: https://raw.githubusercontent.com/toniebox-reverse-engineering/tonies-json/release/tonies.json
2024-12-29T09:15:48.918875726Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server raw.githubusercontent.com:443...
2024-12-29T09:15:48.918955251Z INFO |cloud_request.c:0252:web_request|   trying IP: 185.199.110.133
2024-12-29T09:15:50.289303223Z INFO |toniesJson.c:0124:tonies_update| ... success updating tonies.json from api.revvox.de, reloading
2024-12-29T09:15:50.319238862Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
2024-12-29T09:15:50.319517338Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5081880
2024-12-29T09:15:50.730674168Z INFO |toniesJson.c:0211:tonieboxes_update| Updating tonies.json from api.revvox.de...
2024-12-29T09:15:50.993230006Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
2024-12-29T09:15:50.993311059Z INFO |cloud_request.c:0252:web_request|   trying IP: 157.90.183.226
2024-12-29T09:15:51.003159431Z INFO |cloud_request.c:0382:web_request| Redirecting to: https://raw.githubusercontent.com/toniebox-reverse-engineering/tonies-json/release/tonieboxes.json
2024-12-29T09:15:51.005980638Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server raw.githubusercontent.com:443...
2024-12-29T09:15:51.022848657Z INFO |cloud_request.c:0252:web_request|   trying IP: 185.199.111.133
2024-12-29T09:15:51.305200346Z INFO |toniesJson.c:0238:tonieboxes_update| ... success updating tonieboxes.json from api.revvox.de, reloading
2024-12-29T09:15:51.336300953Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
2024-12-29T09:15:51.336542727Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5081880

The box has the error “owl” .

How can I fix the problem. But at first what is the problem?

Best Regards
Stefan

Have you only removed the # at the 443 line? Not the one stating ports or so some lines above?

Besides that if your teddycloud runs under the same ip as your nas, it’s highly possible that 443 is already in use.

In that case you have to set up another ip for teddycloud. Search for macvlan for that.

1 Like

Hei henryk,
thank you for your fast reply.
That’s how i implementet it:

    #- 80:80 #optional (for the webinterface)
    - 8443:8443 #optional (for the webinterface)
    #- 443:443 #Port is needed for the connection for the box, must not be changed

I have searched the topic macvlan and found this artice:
https://forum.revvox.de/t/working-docker-compose-yml-file-for-creating-the-docker-container/81

Can you help with the change of the file:
NAS IP: 192.168.0.100
NAS domainame: LCARS
Gateway/ Router IP: 192.168.0.1

I coosed 192.168.0.25 for the dockervlan because it is in the “hard” ip range from my dhcp.

Here https://forum.revvox.de/t/working-docker-compose-yml-file-for-creating-the-docker-container/81/4?u=stef they write that for Synology NAS you have to change the name from eth0 to ovs_eth0

Here https://forum.revvox.de/t/working-docker-compose-yml-file-for-creating-the-docker-container/81/5?u=stef they write that you can delete the second last line. ( I want to delete it because I dont understand it). If it is not allowed what sould I write instead?

version: '3'
services:
  teddycloud:
    container_name: teddycloud
    mac_address: 66-66-66-00-00-01  # random 
    networks:
      dockervlan:    
        ipv4_address: 192.168.0.25   # set your own IP-Adress 
    hostname: teddycloud
    domainname: LCARS                       # set your own domain
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80 #optional
      - 443:443 #Port is needed for the connection for the box
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content 
      - library:/teddycloud/data/library
      - firmware:/teddycloud/data/firmware
    restart: unless-stopped
    environment:
     - TZ=Europe/Berlin
    cap_add:
      - NET_ADMIN

volumes:
  certs:
  config:
  content:
  library:
  firmware:
networks:
  dockervlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: ovs_eth0
    ipam: 
      config:
        - subnet: "192.168.0.0/24"      # change it to your own network address!
          #ip_range: "192.168.178.100/26"  # change it to your own network address!
          gateway: "192.168.0.1"        # change it to your own network address!

When I implement this stack I will lose all produced datas (certificates, …) in the docker volumes? ( I think that should be no problem, isn’t it?)
How is it possible for me to come from this window to the Patch Flash (second point) in order to patch the original firmware with the right IP adress and optional ( wlan ssid and password)?

I can’t help with details as I am not using that.

If it’s your first attempt, then usually click on button read flash. (With connected toniebox as described )

It is not the first, attempt. There is already a patched firmware on it.

https://forum.revvox.de/t/back-to-the-start-esp32-box/1161

Then you might go with the unpatched backup. So click load and select the original backup.

If you do not have that, you need to go the legacy way where you can enter the already set teddycloud ip to be replaced with the new ip

Good evening,
I have tried it now with the docker-composer file with some minor changes (ethernet hardwaredescription was changed to eth0.10 and the domainname is now under hash)
The stack update was possible BUT I have no connection with the teddycloud.
Anyone a idea?
Synyology NAS
Docker compose file

#version: '3'
services:
  teddycloud:
    container_name: teddycloud
    mac_address: 66-66-66-00-00-01  # random 
    networks:
      dockervlan:    
        ipv4_address: 192.168.0.25   # set your own IP-Adress 
    hostname: teddycloud
    #domainname: LCARS                       # set your own domain
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80 #optional
      - 8443:8443 #optional (for the webinterface)
      - 443:443 #Port is needed for the connection for the box
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content 
      - library:/teddycloud/data/library
      - firmware:/teddycloud/data/firmware
    restart: unless-stopped
    environment:
     - TZ=Europe/Berlin
    cap_add:
      - NET_ADMIN

volumes:
  certs:
  config:
  content:
  library:
  firmware:
networks:
  dockervlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: eth0.10
    ipam: 
      config:
        - subnet: "192.168.0.0/24"      # change it to your own network address!
          #ip_range: "192.168.178.100/26"  # change it to your own network address!
          gateway: "192.168.0.1"        # change it to your own network address!
2024-12-29T20:08:03.473247238Z TeddyCloud v0.6.2 (203f12d) - 2024-10-26 18:14:34 +0000 ubuntu linux-x86_64(64)
2024-12-29T20:08:03.473859616Z 
2024-12-29T20:08:03.474804882Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
2024-12-29T20:08:03.476305565Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.ini
2024-12-29T20:08:03.477490003Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
2024-12-29T20:08:03.477797056Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.478071187Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
2024-12-29T20:08:03.478357975Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.478503701Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/ca.der' detected as DER style CERTIFICATE
2024-12-29T20:08:03.478656295Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/client.der' detected as DER style CERTIFICATE
2024-12-29T20:08:03.478802913Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/client/private.der' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.478970548Z INFO |settings.c:0848:settings_load_ovl| Load settings from /teddycloud/config/config.overlay.ini
2024-12-29T20:08:03.480943976Z INFO |tls_adapter.c:0390:tls_adapter_init| Loading certificates...
2024-12-29T20:08:03.481044232Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/ca-root.pem' assumed PEM style
2024-12-29T20:08:03.481082558Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.481229762Z INFO |tls_adapter.c:0204:read_certificate| File '/teddycloud/certs/server/teddy-cert.pem' assumed PEM style
2024-12-29T20:08:03.481328250Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.481513267Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/ca.der' detected as DER style CERTIFICATE
2024-12-29T20:08:03.481621664Z INFO |tls_adapter.c:0197:read_certificate| File '/teddycloud/certs/client/client.der' detected as DER style CERTIFICATE
2024-12-29T20:08:03.481731491Z INFO |tls_adapter.c:0201:read_certificate| File '/teddycloud/certs/client/private.der' detected as DER style RSA PRIVATE KEY
2024-12-29T20:08:03.494141286Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 2
2024-12-29T20:08:03.494371808Z INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.json with size 5081880
2024-12-29T20:08:03.902884651Z INFO |toniesJson.c:0100:tonies_update| Updating tonies.json from api.revvox.de...
2024-12-29T20:08:03.903052692Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
2024-12-29T20:08:13.911554299Z ERROR|platform_linux.c:0397:resolve_host| getaddrinfo Temporary failure in name resolution
2024-12-29T20:08:13.911964959Z ERROR|cloud_request.c:0233:web_request| Failed to resolve ipv4 address!
2024-12-29T20:08:13.912012936Z ERROR|toniesJson.c:0130:tonies_update| ... failed updating tonies.json error=Address not found [553]
2024-12-29T20:08:13.912048278Z INFO |toniesJson.c:0211:tonieboxes_update| Updating tonies.json from api.revvox.de...
2024-12-29T20:08:13.912108734Z INFO |cloud_request.c:0200:web_request| Connecting to HTTP server api.revvox.de:443...
2024-12-29T20:08:23.920034724Z ERROR|platform_linux.c:0397:resolve_host| getaddrinfo Temporary failure in name resolution
2024-12-29T20:08:23.920556516Z ERROR|cloud_request.c:0233:web_request| Failed to resolve ipv4 address!
2024-12-29T20:08:23.920603604Z ERROR|toniesJson.c:0244:tonieboxes_update| ... failed updating tonieboxes.json error=Address not found [553]

In the portianer it looks quite good:

cmd
ping 192.168.0.168
no answere

Teddy Cloud Server is running now with following configuration:

#version: '3'
services:
  teddycloud:
    container_name: teddycloud
    mac_address: 66-66-66-00-00-01  # random 
    networks:
      dockervlan:    
        ipv4_address: 192.168.0.25   # set your own IP-Adress (that's the IP Adress from the Teddy Cloud server)
    hostname: teddycloud
    domainname: LCARS                       # set your own domain (that's the domainname of my Synology NAS)
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80 #optional
      - 8443:8443 #optional (for the webinterface)
      - 443:443 #Port is needed for the connection for the box
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content 
      - library:/teddycloud/data/library
      - firmware:/teddycloud/data/firmware
    restart: unless-stopped
    environment:
     - TZ=Europe/Berlin
    cap_add:
      - NET_ADMIN

volumes:
  certs:
  config:
  content:
  library:
  firmware:
networks:
  dockervlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: eth0
    ipam: 
      config:
        - subnet: "192.168.0.0/24"      # change it to your own network address! (That's the Range where my network starts)
          ip_range: "192.168.0.20/28"  # change it to your own network address! (That's the range of ipadresses what the macvlan can choos from /27-> 32 adresses; /28-> 16 Adresses ...) 
          gateway: "192.168.0.1"        # change it to your own network address! (That's the IP adress from my Router)

Summary of/help for implementing the Teddycloud in a Synology NAS

Hardware and infrastructure used
Synology NAS DS220+ DSM 7.2.2-72806 Update 2
Tonies Box ESP32

Network (in this specific case)
Router/gateway: 192.168.0.1
NAS DS220+ IP: 192.168.0.100
IP address of the Docker server created in the creation process:192.168.0.100:9443
IP address of the Teddycloud server created in the creation process: 192.168.0.25:8443

Software used
Firefox/Chrome
Container Manager (Docker Inc. 20.10.23-1437)
Text editor (Synology Inc. 1.2.5-0254)
portainer YAML file
Teddycloud YAML file

Installation Container Manager & Installation Text Editor on the Synology NAS
Implementation of the first Docker container → Portainer
Implementation of the Teddycloud docker-compose file.

Installation Container Manager & Installation Text Editors on the Synology NAS

Container Manager:

Open the DiskStation Manager with 192.168.0.100:5000
Package Centre → All Packages-> Install Container Manager (utility).

Text Editors:

Package Centre → All Packages->Install Text Editor

Implementation of the first Docker container → Portainer

Now open the portainer documentation in the browser (Install Portainer BE with Docker on Linux | Portainer Documentation) and copy the following Docker run command under Deployment:

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.

Modified Docker Composer file:

services:
    portainer-ce:
        ports:
            - 8000:8000
            - 9443:9443
        container_name: portainer
        restart: always
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - ./portainer_data:/data
        image: portainer/portainer-ce:latest

With this step portainer was installed.

Info resource: https://www.youtube.com/watch?v=XfsbuNorSU0 and Install Portainer BE with Docker on Linux | Portainer Documentation

Portainer is the container management software of Docker and can be opened with https://192.168.0.100:9443 (standard port). https is important! A security warning may appear which can be ignored as the homepage has just been created personally.

Now a new user must be created.

Enviorments ‘local’ with the pen in the ‘Environment details’ and enter the IP address of the NAS (192.168.0.100) under the Public IP address and confirm with ‘Update enviroment’.

Implementation of the Teddycloud docker-compose file.

In the solution shown here, the Teddycloud requires a unique IP address that is different from the IP address of the NAS. Macvlan is required for this.
A modified docker-compose file from the following resource is therefore used:
https://github.com/toniebox-reverse-engineering/teddycloud/blob/master/docker/docker-compose.yaml

Additional information:
dockervlan: ipv4_address is the address with which the Teddycloud is accessed via port 8843 (and after the firmware update the Toniebox communicates with the Teddycloud via port 443)

driver_ops: parent is the name of the physical Ethernet interface of the NAS. (You can check whether the name is correct via the SSH interface with the ifconfig command).
Info resource: https://www.youtube.com/watch?v=jCPIUDpqcgw&t=1098s 10:53ff

Ipam:config: -subnet: The network in which the macvlan is to operate is identified here.

ip_range: A range is set here in which the macvlan may assign IP addresses. (the higher the number after the slash, the smaller the range → Info resource: https://www.youtube.com/watch?v=jCPIUDpqcgw&t=1098s)

Gateway: IP address of the router/gateway

Modified Docker Compose file:

#version: '3'
services:
  teddycloud:
    container_name: teddycloud
    mac_address: 66-66-66-00-00-01  # random 
    networks:
      dockervlan:    
        ipv4_address: 192.168.0.25   # set your own IP-Adress 
    hostname: teddycloud
    domainname: LCARS                       # set your own domain
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:develop
    ports:
      - 80:80 #optional
      - 8443:8443 #optional (for the webinterface)
      - 443:443 #Port is needed for the connection for the box
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content 
      - library:/teddycloud/data/library
      - firmware:/teddycloud/data/firmware
    restart: unless-stopped
    environment:
     - TZ=Europe/Berlin
    cap_add:
      - NET_ADMIN

volumes:
  certs:
  config:
  content:
  library:
  firmware:
networks:
  dockervlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: eth0
    ipam: 
      config:
        - subnet: "192.168.0.0/24"      # change it to your own network address!
          ip_range: "192.168.0.20/28"  # change it to your own network address!
          gateway: "192.168.0.1"        # change it to your own network address!

Then click on ‘Deploy the Stack’ at the bottom under Actions

The Teddycloud can now be accessed with the Chrome browser via https://192.168.0.25:8443/
The implementation of the Teddycloud is now complete and you can continue working with the normal documentation and help available.

Thanks again to Henryk and marco79cgn.
Dear moderators team I would like to translate the summary into English in the next few days (I will then add this as another answer, maybe you can merge the two posts then) But if I have written too much nonsense please correct or delete the whole post.

lg
Stefan