Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Control tags simultaneously with the same input #92

Closed
Draexl opened this issue Jul 24, 2023 · 24 comments
Closed

Feature request: Control tags simultaneously with the same input #92

Draexl opened this issue Jul 24, 2023 · 24 comments
Labels
enhancement New feature or request

Comments

@Draexl
Copy link

Draexl commented Jul 24, 2023

In my usecase, all tags should display the same thing. At the moment I can only control one tag with the JSON template upload.
Can this be implemented or is there already a way?

@Draexl Draexl added the enhancement New feature or request label Jul 24, 2023
@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

I just saw that I can store a JSON URL in the TAG.
I have now stored a JSON in File Explorer. What should the URL be now (in the tag settings)?
I can't get it.
used http://192.168.1.100/test.json

@Draexl Draexl closed this as completed Jul 24, 2023
@Draexl Draexl reopened this Jul 24, 2023
@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

OK, I found it. You have to put it in the www folder.
But what doesn't work is the interval function (I used 1 Minute) in the tag settings.
I always have to click on save in the tag settings for refresh.

@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

Ok, I found the Problem. The Minimum time interval time is 10 Minutes. Is it possible to enter lower values? For example. check every 10 seconds? Would be very important to me.

@slimline33
Copy link
Contributor

You can send a refresh after Uploading a New Image or json

@slimline33
Copy link
Contributor

?cmd=refresh

This can you do with curl. I don't know the right way to do it with jsonupload.

@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

My structure looks like this:
I have the JSON file in the ESP/AP directory (Is adjusted via input mask there)
In the TAG settings I refer to the URL of the JSON file.
You can set one minute in the interval, but it is 10 minutes in the background.
That's why I can't send a refresh. I would have to do that for each DAY individually

@nlimper
Copy link
Collaborator

nlimper commented Jul 24, 2023

I have three thoughts on this:

  • ?cmd=refresh should not be misused. In normal operation, it makes no sense using it. If you want to use it to re-initiate a pull request, it's better to use http POST to push the image instead.
  • trying to refresh the displays very fast will not scale well. ESP32 will get too busy drawing useless images, and the tags will not last long with the battery. Polling every 10 seconds is waaaaay to fast. If you want to poll because the image 'might' have changed, it's better to choose a push method. See https://github.com/jjwbruijn/OpenEPaperLink/wiki/Image-upload
  • At the moment, all content of the different tags is independant. The image has to be rendered for every tag individually. Maybe it could be a good idea to be able to set the content of a tags as a copy of another tag, so multiple tags will automatically change if you change the content of the 'source' tag. I will look into it to add that functionality.

@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

Point 2. The picture does not change every 10 seconds. More like every 15 minutes and even just for a few hours. After that, they won't be needed again for a few weeks.
It is currently recognized that nothing should be changed:
LOG: "new image is the same as current or already pending image. not updating tag."

Point 3. That would of course be the very best idea if the same thing is to be displayed on all tags.

@nlimper
Copy link
Collaborator

nlimper commented Jul 24, 2023

By the time the log says "new image is the same as current or already pending image. not updating tag", the image is already rendered from the json (which takes a few seconds).

If you can pull the image from your webserver (instead of misusing the esp32 as a proxy webserver ;-) ), you could make use of the 'If-Modified-Since'-header. The esp32 sends this header, filled with the last time the image was fetched. Your webserver could then send a http 304 if your image hasn't changed since that last time. This way, you can still do fast polling, but without unnecessary image rendering.

Or, like mentioned, use http POST to push changed.

I will start working on the 'mirror tag contents from another tag', I estimate to finish that in 1-2 weeks.

@Draexl
Copy link
Author

Draexl commented Jul 24, 2023

Great, thanks for the info. I will then wait for your implementation with the Master / Slave

@Draexl
Copy link
Author

Draexl commented Jul 27, 2023

A request. Is it possible with the Master Slave implementation that the transmission "optional" works simultaneously? Even if this function requires a lot of battery capacity, no problem. The tags are only used temporarily (no long-term use)

@nlimper
Copy link
Collaborator

nlimper commented Jul 31, 2023

The current protocol doesn't allow for some kind of broadcasting the content. So it has to be send individually.

@Draexl
Copy link
Author

Draexl commented Aug 1, 2023

OK, understood. I'm definitely looking forward to the master/slave implementation :-)

@nlimper
Copy link
Collaborator

nlimper commented Aug 3, 2023

done! You can check it out:
df783c6
At a content card, you can choose 'display a copy' and set the mac address of the tag you want to mirror.
A mirrored tag doesn't take any file system space (if the tag is local to the AP). But the data still has to be send individually to the tags (there is no broadcast option in the protocol), so they still update one by one.
Let me know the results. :-)

@nlimper nlimper closed this as completed Aug 3, 2023
@Draexl
Copy link
Author

Draexl commented Aug 3, 2023

Thanks alot. How can I install it? Unfortunately, my case is glued and I can't get to the RST button on the esp. Unfortunately, only OTA is then possible.

@nlimper
Copy link
Collaborator

nlimper commented Aug 3, 2023

If you plan to ever do some development yourself, you can install vscode and platformio, and compile the source. Using the usb-c port, you can program the esp32-s2 in your access point without pressing any of the buttons (that's only needed the first time when you start with an ompty esp32-s2).
But if you're not planning to ever make changes to the source yourself, installing vscode and platformio is a bit overkill. In that case, I would wait until the next release, which should be in a few days. The changes will be there, and you can use OTA to update.

@Draexl
Copy link
Author

Draexl commented Aug 6, 2023

Yesterday I switched to 0.8. But could not find a display a copy on the content card.

Today, I switched back to 0.7. (Completely reinstalled). But apparently no OTA update is currently possible anymore. Is this known? The system means the .bin file is missing.

@nlimper
Copy link
Collaborator

nlimper commented Aug 6, 2023

what is the exact message you're getting?

@nlimper
Copy link
Collaborator

nlimper commented Aug 6, 2023

About 'But could not find a display a copy on the content card' -> look in the /www folder. If you see two files 'content_cards.json', and 'content_cards.json.gz', delete 'content_cards.json' and leave the .gz one (you can do that with all duplicate files). I could not automatically delete it, because of the risk of bricking if the update was stopped halfway (the delete process runs before the download process). Next release these files will be automatically deleted.

@Draexl
Copy link
Author

Draexl commented Aug 6, 2023

what is the exact message you're getting?

It works... did you do something? It didn't work all day...

@Draexl
Copy link
Author

Draexl commented Aug 6, 2023

About 'But could not find a display a copy on the content card' -> look in the /www folder. If you see two files 'content_cards.json', and 'content_cards.json.gz', delete 'content_cards.json' and leave the .gz one (you can do that with all duplicate files). I could not automatically delete it, because of the risk of bricking if the update was stopped halfway (the delete process runs before the download process). Next release these files will be automatically deleted.

I check it

@Draexl
Copy link
Author

Draexl commented Aug 6, 2023

i do it, but i can't see nothing

Bildschirmfoto 2023-08-06 um 14 49 32
Bildschirmfoto 2023-08-06 um 14 49 53

@nlimper
Copy link
Collaborator

nlimper commented Aug 6, 2023

Hm :-( For some reason the updated file didn't end up in the release. Use this one attached.
content_cards.json.gz

@Draexl
Copy link
Author

Draexl commented Aug 6, 2023

Works, Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants