Can't find flashed Toniebox in Teddycloud

Hi there, I can’t find the Toniebox in my teddycloud after flashing it.
I found the test and troubleshooting page:

But I am not really sure what to do.
I tried the command (after stoping the container)
docker logs teddycloud

But the log writes (many times): buffer does not contain null terminator

Some help would be amazing - I don’t want to give up on the last few meters now :stuck_out_tongue: .
Thanks!

Leave the container running

then enter docker logs -f teddyclou, insert some empty lines (hit multiple times enter) and then do a freshnesscheck on your teddycloud.

what are the logs then showing?

I did what you said:

  1. docker logs -f teddycloud
  2. pressed enter several times
  3. freshness check (for all those who don’t know what is meant: Test & Troubleshooting | Toniebox Hacking)

Now Toniebox tells me: Codeword ant (Ameise)
So no stable internet connection - I probably entered the WLAN password incorrectly?

Log:

WARN |platform_linux.c:0292:socketReceive| buffer does not contain null terminator (very often …)
INFO |handler_cloud.c:0041:handleCloudTime| >> respond with current time
INFO |mqtt.c:0687:mqtt_init_box| Skipping client ‘Toniebox’ (cn: ‘default’)
WARN |platform_linux.c:0292:socketReceive| buffer does not contain null terminator (very often …)
INFO |handler_cloud.c:0041:handleCloudTime| >> respond with current time
INFO |mqtt.c:0687:mqtt_init_box| Skipping client ‘Toniebox’ (cn: ‘default’)
WARN |platform_linux.c:0292:socketReceive| buffer does not contain null terminator (very often …)
INFO |handler_api.c:2374:handleApiTonieboxJson| Trying to read /teddycloud/config/tonieboxes.json with size 3022
WARN |platform_linux.c:0292:socketReceive| buffer does not contain null terminator (very often …)
INFO |handler_cloud.c:0041:handleCloudTime| >> respond with current time
INFO |mqtt.c:0687:mqtt_init_box| Skipping client ‘Toniebox’ (cn: ‘default’)

This sounds strange. The ca.cer of your Toniebox Backup must not be copied to the server folder of your Teddycloud instance. Your Teddycloud has its own CA certificate which has been generated upon the first start and this is also the one you have flashed/replaced on your Toniebox (hopefully).

The original three certificates of your Toniebox only have to be copied to the client folder of your Teddycloud instance!

If your flashed Toniebox has another ca.der in its flash than your Teddycloud instance in its server folder, it‘s no wonder that they can‘t communicate with each other.

I didn’t copy any certificates by hand. Was all done by the tool (teddycloud ESP32 Box Flashing).
The comment you are refering to is a post from someone else :slight_smile:

Ok, well, why did refer to it? Sounded like you did the same. :slight_smile:

You have to explain in more detail what you did and how you did it? Until now you didn‘t even mention your box type. And the log is really short.

So in your logs, there is no attempt visible that your Toniebox tries to connect to your Teddycloud. Together with codeword „Ant“, I‘d guess one of these two things is your problem

  1. your DNS is wrong for the two domains prod.de.tbs.toys and rtnl.bxcl.de. You definitely need both, make sure they are not blocked (Adguard/Pihole) and that they resolve to your actual Teddycloud IP
  2. your certifcates are wrong or don‘t match

What do you mean with WiFi? Haven‘t you set up your WiFi before this whole flash process?

Sorry, I didn’t mean to cause chaos :-). I referred to it because it was a similar topic, but have now taken it out to prevent further confusion.

  • BOX: ESP32 (V4 ?)
  • Setup: Raspberry PI (5)
  • Teddycloud develop (was necessary for the baudrate, without it it didn’t work).

I went through the 4 steps of the TEddycloud flash tool. I entered the WLAN data in the third (?) step.

The Toniebox itself was not connected to the WLAN (I set it up in a different WIFI network at the time). And I assumed that this was not a problem.

After successfully flashing (via the Teddycloud tool), I completed everything, assembled the box and tried to find the box. Without success.

Then I ran the freshness check and got the error “ant”.

What do you mean with WiFi? Haven‘t you set up your WiFi before this whole flash process?

Probably the problem … ?

What did you entered as hostname?
The ip of your teddycloud server?

Is your toniebox visible in your WiFi? (Check in your router)

If not , repeat the flashing (load flash (original backup!) not read flash !), set ip of tc as hostname and enter the desired WiFi credentials and then complete the flashing

Don’t mix it up with other versions. If he entered the right ip in the web gui flash process, he has NOT to set any dns redirects.

What did you entered as hostname?
The ip of your teddycloud server?

The IP that i need to open teddycloud in the browser (172.19.0.2)

Is your toniebox visible in your WiFi? (Check in your router)

It looks like the Toniebox is not connected to the router. Does not show up as a device.

If not , repeat the flashing (load flash (original backup!) not read flash !), set ip of tc as hostname and enter the desired WiFi credentials and then complete the flashing

Doing so right now

Then the missing WiFi connection is the problem. Hopefully the reflash solves that.

Do I have to connect the Toniebox to the existing network beforehand? Or does the client take care of this during setup?

So, to be on the safe side, I also stored the WiFi network in the Toniebox beforehand. Then I reflashed it (of course, I imported the backup beforehand). This time I made sure that the password was correct.

Now the following happens:

I can see in the router that the Toniebox appears briefly when I do a freshness check - and then disappears again immediately. Then the code word “ant” appears again.

The log from the Docker container now looks a bit more meaningful (much more before that - not sure what you need):

INFO |esp32.c:1380:esp32_get_partition| Search for partition ‘assets’
INFO |esp32.c:1399:esp32_get_partition| Found partition ‘assets’ at 0x00F000
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\CA.DER to ‘/teddycloud/certs/client/48ca4344f5e0/CA.DER’ (1419 bytes)
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\CLIENT.DER to ‘/teddycloud/certs/client/48ca4344f5e0/CLIENT.DER’ (1030 bytes)
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\PRIVATE.DER to ‘/teddycloud/certs/client/48ca4344f5e0/PRIVATE.DER’ (1190 bytes)
INFO |handler_api.c:1232:move_cert_file| Skipped identical CLIENTINFO |handler_api.c:1232:move_cert_file| Skipped identical PRIVATEINFO |handler_cloud.c:0041:handleCloudTime| >> respond with current time
INFO |mqtt.c:0687:mqtt_init_box| Skipping client ‘Toniebox’ (cn: ‘default’)
INFO |esp32.c:1380:esp32_get_partition| Search for partition ‘assets’
INFO |esp32.c:1399:esp32_get_partition| Found partition ‘assets’ at 0x00F000
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\CA.DER to ‘/teddycloud/certs/client/48ca4344f5e0/CA.DER’ (1419 bytes)
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\CLIENT.DER to ‘/teddycloud/certs/client/48ca4344f5e0/CLIENT.DER’ (1030 bytes)
INFO |esp32.c:1102:esp32_fat_extract_folder| Write 'CERT\PRIVATE.DER to ‘/teddycloud/certs/client/48ca4344f5e0/PRIVATE.DER’ (1190 bytes)
INFO |handler_api.c:1232:move_cert_file| Skipped identical CAERROR|handler_api.c:1336:handleApiESP32ExtractCerts| Different CLIENT already exists at /teddycloud/certs/client/48ca4344f5e0/client.der
WARN |tls_server_fsm.c:0260:tlsPerformServerHandshake| TLS handshake failure!
INFO |server.c:0931:server_init| 2 open HTTPS Web connections
INFO |server.c:0931:server_init| 1 open HTTPS Web connections
INFO |server.c:0931:server_init| 0 open HTTPS Web connections
WARN |tls_server_fsm.c:0260:tlsPerformServerHandshake| TLS handshake failure!
INFO |server.c:0931:server_init| 2 open HTTPS Web connections
INFO |server.c:0931:server_init| 0 open HTTPS Web connections

The good thing is that the existing Tonies can be played again. This was not possible before.
But the connection to the cloud is of course not possible without WiFi.

Out of curiosity, with esp boxes you can’t add/change a wifi connection without flashing?
At least from a user testimonial here, where I suggested they add their wifi connection via the hotspot of the Toniebox itself, it worked. This was a cc3200 box though.

Not sure about that. Works fine on my site and I do not change anything.

Maybe you can try the original WiFi setup with the modified firmware?

You can add a new WiFi without flashing as on every box. Just use the default process for that. Pressing both ears very long and connect to the box wifi ap

1 Like

Does anyone have any idea why the Toniebox is connected to the network for a short time and then disconnects again immediately?

Like described here:

So I tried again today after restarting everything - without success.

I still have no idea why the Toniebox connects to the router for 2-3 seconds and then immediately disconnects again.

Any suggestions on how to deal with the problem?

If the router really kicks your Toniebox, I don‘t know why this should have anything to do with Teddycloud or the exchanged certificate.

But if you want to be 100% sure that your Toniebox doesn‘t have WiFi issues in general, reflash the original firmware and try to use it with the original Toniecloud/Boxine. Then recheck if it works flawless and stays connected to your router‘s WiFi.