Commit Graph

105 Commits

Author SHA1 Message Date
Moritz Wirger
2e44889b19 Add custom tag data parser (#132)
* Add formatString convenience function

* Use String& for wsLog, wsErr and wsSerial

* Add tag data parser and parse tag data

* Make logLine use String&

* Fix issue with formatString

* Reuse payloadLength in processTagReturnData

* Fix parsing of unsigned/signed inetegers and cleanup

* Use c++17 standard

* Cleanup logging
2023-09-26 22:51:57 +02:00
Nic Limper
75c6a6c0f9 previews now also show for tags connected to external AP; removed extra debug msg 2023-09-24 21:34:30 +02:00
Nic Limper
a91dd5c2a2 fix hangs on esp32-s2; refactor task runner; moved some json objects from the stack to the heap
temporary, there's some extra debug info on the terminal. Will be removed again in the near future.
2023-09-23 18:40:28 +02:00
Nic Limper
0ba287f734 mutex on file write; prevent other AP from stealing tag content; bigger heap for timeTask 2023-09-22 19:42:36 +02:00
Nic Limper
2d84583797 update button: download latest esp32-c6 firmware + flash from esp32-s3 2023-09-19 20:24:57 +02:00
Nic Limper
7e32a1a197 remove unused preview files from /current folder at startup 2023-09-11 13:50:37 +02:00
Nic Limper
a92e0eb5e6 flashing ESP32-C6 from ESP32 via serial connection from webinterface
To flash the C6, place bootloader.bin, partition-table.bin and OpenEPaperLink_esp32_C6.bin in the file system root.
APconfig -> update -> advanced options -> update ESP32-C6
This should also work with a previous unconfigured C6.
Compatible with Yellow-AP.
2023-09-11 00:48:08 +02:00
Nic Limper
2780b7ce36 only send fast lut to capable tags 2023-09-08 23:58:52 +02:00
Jelmer
dc33ff5854 ESP32 return-data support 2023-09-08 11:19:33 +02:00
Moritz Wirger
36c3c45510 Json url file template (#128)
json template url + file implementation. 
The file contains the json template, and can contain variables that will be extracted from the json in the url. The url is fetched at regular intervals.
2023-09-08 11:06:15 +02:00
Nic Limper
eba0ea8a89 simple http call to test the led flasher 2023-08-31 20:12:49 +02:00
Nic Limper
ab83cb03cc improvements for yellow ap / esp32-c6
- Wifi connection progress is now visible on the TFT
- passthrough serial logging from the C6 to the S3 terminal for easier debugging
- no checks on force_flash and APtag-firmware version when C6 is used
2023-08-31 02:13:45 +02:00
Nic Limper
9929d1646f small fixes
- fixed context menu position
- fixed free space sometimes displays 0
- added 12 byte payload to sendCommand
2023-08-29 22:11:05 +02:00
Nic Limper
79efe473bf various small fixes
- clean up webproxy getExtUrl
- bugfix init multicast on wifi reconnect
- add ip address of remote AP that's taken over a tag
- renamed button 'edit contentFS' to 'file system'
2023-08-23 01:29:52 +02:00
Nic Limper
f268c48717 add wifi events to log.txt 2023-08-22 13:06:42 +02:00
Nic Limper
2edbf27033 various fixes / sleep at night / resend image at tag boot
- apconfig: configure night time, where the system is not updating tags, and the tags are sleeping
- fixed bug calculating expected checkin
- throttle down apinfo update to once per minute
- fixed too many concurrent requests getting tagtypes
- resend current image when a tag reboots and the content type is 'static image' (all other content types were already regenerating the content)
- fixed timing of main loop
2023-08-20 20:16:34 +02:00
Moritz Wirger
fce6c16153 Optimize tagDB and reduce RAM usage (#113)
* Reduce code size by removing nullptr assignments

* Optimize tagDB for loops

* More tagDB optimizations

* Remove static from language arrays reducing RAM by 5128b

- Reduces Flash by 13060b

* Add missing extern in tag_db.h

* Fix deprecation warning of sntp.h

* Remove static from contentmanager, reduces RAM by 184b

* Use string reference in prepareDataAvail

- Remove some unneeded buffers
- Remove some gotos
2023-08-17 10:06:21 +02:00
Nic Limper
77cbf92281 bugfix getlocation 2023-08-13 01:48:32 +02:00
Moritz Wirger
c4022e45f9 Fix weather icons exception (#114) 2023-08-13 01:00:47 +02:00
Moritz Wirger
6c91c78aa1 Refactor contentmanager (#112)
* Start contentmanager cleanup

- Make destination constant
- Remove unneeded asignments
- Improve loops
- Move printHeap function into util

* Refactor contentmanager::drawNew

* Optimize contentManager::replaceVariables

* Fix missing const in prepareCancelPending

* Refactor drawDate

* Refactor drawWeather, drawForecast & getLocation

- Generalize http get json function

* Add util function for printing largest free block

* Reuse weather icons for both drawWeather & drawForecast

* Make httpGetJson timeout const

* Reafctor more functions

* Add few more const

* Fix spelling mistake

* Add util for debugging streams

- Add util for checking if strings are empty or contain null
- Fix file and string checks

* Remove leftover debug print
2023-08-12 16:57:42 +02:00
Nic Limper
56e1e9e6b6 small fixes
- build in led on esp32-s2 active low
- floyd steinberg dithering improved
- add tokyo time zone
2023-08-12 13:18:22 +02:00
Moritz Wirger
19f6a093d3 Cleanup ota files (#111)
- Constify everything
- Remove duplicate code
- Fix warnings in js
- Reduces bin size from 1283453 to 1283273 bytes
2023-08-12 00:37:26 +02:00
Nic Limper
f4273630ee rework of apinfo screen + variables in jsontemplate
- AP info screen content card. Can run on any tag.
- now, you can use {variables} in the 'text' entries in a json template. You can set variables via a http call. If you update a variable, all tags with a json template containing that variable get updated.
- font name in json template is more flexible. You can just use 'filename.ttf' or 'filename.vlw'. A full path is still possible.
- colors in the json template can now be set using #rrggbb color values, and using 'black', 'white' or 'red'.
- added direct output for the TFT display for the yellow esp32-s3. No file writes needed.
- added POST variable 'ttl' to json template upload and image upload, to set the next checkin time
- added /variables-demo.html to demonstrate the variables.
- json templates received from jsonupload are now saved in /current, and reused.
- known issue: 'backup db' button doesn't work due to some browser policy change. Fixing.
thanks to @steinwedel for the inspiration on the variables and some other fixes.
2023-08-11 18:46:46 +02:00
Nic Limper
ffd0acff72 tft driver for yellow board 2023-08-09 23:40:39 +02:00
Nic Limper
09f7466f6f new flexible tagtype definition
- new: tagtypes are be defined via json in /tagtypes instead of hardcoded
- content template is moved to the tagtype definition
- optimalisation of spr2buffer (also uses psram now, if available)
- bugfixes in spiffseditor
- size fix in painter screen for large screens
2023-08-08 16:31:20 +02:00
atc1441
3079101c48 Tag DB Size was only 8bit now 32bit, need to be fixed in further UDP usage later as well 2023-08-07 11:53:28 +02:00
Nic Limper
66cc62339f fix aligning U8G2 fonts / improv protocol fix 2023-08-05 22:05:33 +02:00
Nic Limper
df783c6f8f ability to mirror tags
mirrored tags don't take file system space (f they are local to the AP), and don't take time to generate. They share their buffer with the source tag.
2023-08-03 12:37:29 +02:00
Nic Limper
b4bf060a51 json template is now streaming (both file and url)
'unlimited' size
2023-07-31 22:35:00 +02:00
Nic Limper
e3407468ea weather icons via truetype
Don't forget to update the file system: added .ttf font, deleted some .vlw fonts.
Saves about 144kB.
2023-07-31 20:25:31 +02:00
Nic Limper
8daff632ba truetype: more floats -> better rendering 2023-07-31 20:22:50 +02:00
Nic Limper
21a52e9b17 truetype fixes
- fixed curves using intermediate points
- now uses ascender to find baseline
- now uses unitsPerEm for font size calculations
rendering is not perfect yet, probably mainly due to rounding issues
2023-07-31 19:02:05 +02:00
Nic Limper
f9b4d163bc cleanup and gzip web files
- clean up unnecessary files
- fix ota update, maybe preventing timeouts
- new 'wwwroot' folder for the web source files, and python script to gzip the files to the /data/www folder
- run gzip_wwwfiles.py to compress the files in wwwroot into /data/www
2023-07-29 20:47:12 +02:00
Nic Limper
a78f2e3af5 added truetype fonts 2023-07-29 14:47:01 +02:00
Nic Limper
26af93dd67 bugfixes
- replaced symlink to firmware pack binary by real file
- bugfix using jsontemplate with google apps script
2023-07-29 10:34:56 +02:00
Nic Limper
9300301dcb small bugfixes
- small layout fix current weather on 4.2"
- qr code content enabled again
- turned off temperature on esp32
- http 409 on http POST during OTA
- finetuning buitenradar scale and refresh time
- follow redirects on jsontemplate http call
2023-07-26 21:50:58 +02:00
Jelmer
9ce9abd59e new flasher, support for nRF 2023-07-22 00:02:33 +02:00
Nic Limper
4eb89e9596 added improv protocol for wifi provisioning 2023-07-19 17:27:00 +02:00
Nic Limper
6db2f7f9bc replacing wifimanager
This one saves a lot of flash space.
Now, wifimanager is replaced with our own method for managing the wifi connections.
Also, the whole thing will run now even if there is no wifi. If wifi disappears, it automatically tries to reconnect in the background every few minutes.
Wifi settings now available at all times at /setup
If it cannot connect, an access point 'OpenEPaperLink' is created where you can set the wifi credentials (http://192.168.4.1/setup).
2023-07-19 15:00:52 +02:00
atc1441
ecdadf8c47 Added Display Access Point Infos on Boot on AP Display 2023-07-17 12:43:31 +02:00
Nic Limper
95711647a3 json template push, and some clean up 2023-07-12 01:42:33 +02:00
Nic Limper
5f48acc6f2 json template 2023-07-11 23:24:05 +02:00
Nic Limper
128fcb0aee fixed sntp blocking on no internet connection 2023-07-11 20:39:08 +02:00
Nic Limper
b178994bd6 apconfig option to turn off preview images
- option to turn preview images off in apconfig
- better browser cache of preview images
- bit of memory optimization on the contentmanager
2023-07-11 13:58:03 +02:00
Nic Limper
112a467cff added wifi power and time zone to APconfig
- added wifi transmit power option
- added time zone config option
- small fixes
2023-07-09 00:56:48 +02:00
Mimoja
a60bc91205 ESP: Fix Powermanagement for non-configured POWER
We currently have two ways of undefining the PowerPin in software for the ESP32
For once we can set POWER_NO_SOFT_POWER which will lead to some helpful screen
messages _but_ will still require the definition of the FLASHER_AP_POWER pin.

The second way (which was replaced with POWER_NO_SOFT_POWER) allowed to set the
powerPin array to {-1} to indicate that the pin is undefined. This would then be
handled in pretty far down the call stack right before toggeling the pin in powerControl:

```
 void powerControl(bool powerState, uint8_t* pin, uint8_t pincount) {
    if (pin[0] == -1) return;
```

This however is leading to an error: pin is n pointer (here an array with additional length)
to an uint8_t which can never be -1. Therefore the check wont ever be reached and an invalid
gpio number is passed to the gpio hal.
This caused the error:
```
  E (XXXX) gpio: gpio_set_level(226): GPIO output gpio_num error
```
to show up in the logs.
We are now proposing three seperate changes to mitigate this behaviour:
1) We are addng the POWER_NO_SOFT_POWER to the Wemos and the M5Stack boards default configs
for new users to find.
2) We are replacing the pin[0] check in powerControl with a check on the pincount and a
nullptr check as the zbs_interface->begin() allows for no powerPin to be passed in which
case we are dereferencing a nullptr.
3) ZBS_interface->begin() is losing its powerPin related default configurations and
sanity checks are put in place before every calling.

We have opted to do 3) in this way and not adding the checked into the ZBS_interface->begin()
function which is also passed an uint8_t pointer to keep the API of the class stable
for reuse in other projects. Changing the interface however would be ideal here

Signed-off-by: Mimoja <git@mimoja.de>
2023-07-03 21:39:41 +02:00
Nic Limper
42a3651075 channel id, tag fw version and tag commands integrated in webinterface 2023-06-28 13:11:33 +02:00
Jelmer
da6d783e3b added new larger availdatareq struct for esp32 2023-06-27 23:17:01 +02:00
Mimoja
e45845e00e Add SPIFFSEditor header to match imported source file
The SPIFFSEditor.h header is being imported from the .platformio folder
while the corresponding .cpp is actually stored with the project.
To ensure we can not accidentally edit the wrong file in the future import
the header as well

Signed-off-by: Mimoja <git@mimoja.de>
2023-06-25 13:12:56 +02:00
Mimoja
93639ff8ac Disconnect SDCard if it shares the pins with the flasher
Signed-off-by: Mimoja <git@mimoja.de>
2023-06-20 17:51:10 +02:00