Different content dirs for each box

I finally managed to get all boxes running with certs and settings in place. Thanks for the enhancement of the new web UI!

I bought a ton of custom tags/cards (about 50) and I would really like to assign some to one box some to the other. I understand the content directory is currently shared. I guess two things need to happen to get this working:

  1. The overlay config needs to allow for a different content directory for each box
  2. The list of Tonies (which is a list of custom tags for me) needs a selection on which box it’s been used or for which box it is valid. This could be a read only list property even, which changes once a tag is placed on another box - effectively adding it to the content directory of that box.

Does that make sense? Should I open an issue on GitHub for this?

Thanks,
Alex

This is already possible by setting a different content dir. But his is currently not supported by the webgui.

I don’t see, that is something that makes sense for me. What is the use case for that?

This makes sense if some tags are used exclusively on one specific box. E.g. a family sharing a TeddyCloud instance where the boxes are geographically apart.

I know we’re nowhere near a multi-user setup. But if list of Tonies would store a property on which box it was “seen”, each “user” would be able to filter for the Tonies available to his/her box.

maybe this will be solved if the label functionality is added. this will not automatically set the label, but you can set the label manually.

Getting a list of all Tags is already possible. But we are missing a implementation of that for the frontend and some discussions about the edge cases and the how.

You may get a list of all tags via following API call:
/api/getTagIndex?overlay=

Lets collect some free swinging thoughts about it…

Adaptions Tonies List Page

There will be a selection on the tonies list page where you can select the a toniebox for which you will see the content.

→ mutliple boxes with subsets sharing the same content → instead of selection a box, the actual folder would be better

  • collect folders of all boxes and group them accoring folder (and show the boxnames of each folder in the select) - what should be the initially set one? (i would store the value in the localStorage of the browser)
  • if there is only folder: still show the select, but automatically select that
  • even if more boxes share the same folder, we need to use one of them for the api call
    • but if we change one of the boxes to get the own content dir, this logic breaks → we need to reset the prechoosen folder

How to see ALL content of ALL Boxes

  • need to fetch the content of each folder and them merge the arrays.

Change of the content dir folder
If you do so, take care of the content yourself. There will be no functionality moving the existing content to the new folder.

Edge Cases - Special Care

  • Homepage - 6 random tonies…
    • which one should be shown? :speaker: → current solution: Random from merged contentDirs
  • Toniebox management - last played tonie
    • just makes it a bit more complicated :speaker: → actually no change… its like a new tonie
  • Open last played Tonie from Toniebox management
    • We need to pass the overlay-Id of the box additionally and ignore the preselected Contentfolder, the Box selection must be changed to the foldergroup of the last played tonie source box :speaker: → choosen folder is changed for that actually
  • Updating Live, NoCloud, Model and Source must support overlay :speaker: –>added in frontend, some adaption necessary in backend
  • Same tags, but different Content in content folder :speaker: –>no changes planned in frontend
    • this only matters if you would like to show all available Tags regardless the boxes
    • currently there will be no solution for that
    • there should be no problem with an single custom tonies json as the audioID is used to match the tag - @0xBadBee Am I right with this assumption?

Backend (more for understanding)

  • new tonie. Assume three boxes A, B, C, each with its own content.
  • I place tonie on Box A → Content is fetched from Boxine and stored Library, but tag.json in Content Folder B_A
  • I place the same tonie on Box B → is content again fetched from Boxine ? (I assume yes) → will it overwrite the library taf file? Or will it be recognized, that this is already available in library? However The tag.json will be added in Content Folder B_B

Anything else coming to your mind i might forgot? I am sure there will be some more things when starting implementation.

The current implementation adds a select to the tonies page (and content + system sounds) where you can select the groups of tonieboxes which share the same folder. If you have a separate folder for each box, you can select every box.

Currently there seems some problem with existing data on the box. After first connection after separation of content dir, all known tags of the box are added to the new content dir. All the entries are shown as Valid: no and Exists: no.

@adn77 next release 0.5.2 is your release :wink:

Wow, a couple of days out of town and my wishful thinking is becoming a reality :slight_smile:

Catching up on the PRs now…

we think that you own us now approx 5 tonieboxes :wink:

found a lot places in the code where the overlay (which is used to get boxrelated settings) was not working correctly or not added. I assume @0xbadbee has some nightmares already with someone saying overlay missing :wink:

Please be aware that you have to do something after you set up your multi content dir setting. I added some hints in the release notes → Release Notes 0.5.2 if you have any question, feel free to raise them here or there or in the telegram group.emphasized text

1 Like

Too bad I only have two (and owning only one of them) :smiling_face:
I certainly do appreciate all your fantastic work though! Up until the last CCC I didn’t even want a Toniebox in my house, now I keep telling everybody about it…

1 Like

This is absolutely awesome! It’s precisely what I had imagined. The last played Tonie on each box comes in handy for naming and linking the custom tag with the correct library content.

Thanks again to all involved!

There is one thing I noticed that might cause confusion; there is not really a point for the “Content” section in the web frontend. One can see all the TAFs in the “Library”. The “Tonies” now assume the role of what used to be the “Content” section.

I understand that the content represents the state of the internal SD card, but for the user this should be irrelevant.

Finally an editor for the tonies.custom.json would be wonderful :smile: I know an issue for that already exists on GitHub. Until then I am going to edit it on the shell.

After release is before next release :wink:

the editor is already in our mind, will be one of the next things to come

The content section will contain in next release some buttons to do the migration to lib.

(i know, there is already a script circulating here, but there is also an API which can be used.)

1 Like

There might be a small bug, affecting the frontend only (so far). I get the following error when I start the new /web frontend:

teddycloud  | INFO |handler_cloud.c:0041:handleCloudTime|  >> respond with current time                                                                                                                          teddycloud  | INFO |mqtt.c:0684:mqtt_init_box| Skipping client 'Toniebox' (cn: 'default')
teddycloud  | INFO |cloud_request.c:0162:web_request| Connecting to HTTP server prod.de.tbs.toys:443...                                                                                                          teddycloud  | INFO |cloud_request.c:0212:web_request|   trying IP: 3.69.182.181                                                                                                                                  teddycloud  | INFO |cloud_request.c:0038:httpClientTlsInitCallbackBase| Initializing TLS...
teddycloud  | ERROR|cloud_request.c:0222:web_request| Failed to connect to HTTP server! Error=Invalid parameter [2]
teddycloud  | ERROR|handler_reverse.c:0034:handleReverse| cloud_request_get() failed

This is repeated another nine times.

I assume this has got something to do with the Boxine status indicator (which shows “inactive/red”).
The cloud is working on at last one of the boxes nonetheless.

I tried copying the box certificate to the global certificate settings location but that still dioesn’t help.

It’s really nothing too important, just wanted to report it. :slight_smile:

Ooops, I should have restarted TeddyCloud before posting :frowning:

After I copied the client certs to their default location and restarted, no more errors and a green “Boxine” sign on the frontend.

All good, sorry for the noise!

Just had a look into my logs and nothing looks like you mentioned. But you found the problem already :slight_smile: