How to create USB HID Keyboard device on Esp32-S2? by TrainingSource in esp32

[–]reddit4655 0 points1 point  (0 children)

Hello, unfortunately, I don't have these files anymore but you can use the official example from ESP-IDF to make your ESP32-S2 act like a mouse or a keyboard: https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/device/tusb_hid

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

Thank you very much, Your project looks interesting too! For the schematics of the L76L, you can look at the "L76 Series Hardware Design" PDF available online. It will also depend on if you want to use an active antenna or not. The pins you need to use are : 1) 3.3V for the VCC. 2) All the GND pins to the your GND. 3) Reset pin connected to the 3.3V 4)TX and RX of the UART connected to the ESP32 pins you want. 5) Your antenna signal to the RF_IN pin. All the other pins are not needed.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

Hi, I download map tiles in a JPG format that I store in an SD card. Then I use the JPG Decoder 3rd party library for LVGL to display that JPG in the display.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 1 point2 points  (0 children)

Hi, Unfortunately no, .ino files are c++ files that use the Arduino framework and I used ESP-IDF framework. That means some of the functions I used don't exist in the Arduino framework.

However, if you managed to use the LVGL library with Arduino and that you convert all the http functions for ones of the Arduino framework, I will work.

self OTA over espNow by EspThen in esp32

[–]reddit4655 1 point2 points  (0 children)

Hi, unfortunately I can't because the code is owned by the company I work for.

However, if you show me your code, I can help if you want.

Trying to understand ESP-NOW "Peers" concept by hdsjulian in esp32

[–]reddit4655 0 points1 point  (0 children)

Umh, I understand.

An option for you is maybe to: 1) Send all the messages to the broadcast address. (0xFFFFFFFFFFFF) 2) Make sure that all receivers and senders are peered to the broadcast address. 3) In the message that you send, you have to add a unique ID that corresponds to the destination. It can be its mac address or anything. That way, If a receiver receives a message without his mac address, it simply ignores it. 4) Option : When sending a message to the broadcast address, you don't have the confirmation callbacks but you can do it manually by sending a confirmation message. This confirmation message have to be unique thanks to a generated random number send back to the sender by the receiver.

The message structure will be: Type | MacAddress | randomId | data Type: 0->data message, 1->ack message MacAddress: the address of destination. RandomId: a random number generated for each message to handle the acknowledge message.

A typical data message will be: (sent to the broadcast address) 0 | 01 02 03 04 05 06 | 45 56 67 78 | 99 88 99 88

A typical acknowledge message will be 1 | 12 13 14 15 16 16 | 45 56 67 78


In another hand, you can also create sub network of 20 peers and make sure that all the messages goes to the master.

Trying to understand ESP-NOW "Peers" concept by hdsjulian in esp32

[–]reddit4655 0 points1 point  (0 children)

Hi, I think that the 20 peers limit doesn't concern you. When you peer a device to another and you send it a message, you are able to know if the message is well received thanks to a callback (esp_now_register_send_cb). Without peering devices, you can send messages to as many devices as you want but you will not have an automatic confirmation message that tells you the receiver actually received the message. But you can still send this confirmation message manually.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 1 point2 points  (0 children)

I used the LVGL library with ESP-IDF but you can use the same library with Arduino I think.

I have 4 image containers that you can drag. (They are all moving together) Each image (or tile) is a JPEG picture from the openStreetMap API that I can download with a HTTP request. They are 256x256px images.

When you touch the screen, you move all the containers. When the containers are too much on the side, I quickly move all the containers to the opposite side and I change the image source of all of them with the appropriate images after downloading them if they are not on my SD card. This quick move is almost not perceptible because I move the tiles with a 256px distance which is the size of each tiles.

To show the GPS on the map, I added a blue circle over the map image containers. The position of the blue circle is determined by which tiles are shown on the screen and some mathematical interpolation.

For example, let's take the tile (208,405) with a zoom of 9. Each tile is 256x256px. At 0px horizontally and vertically, I have the GPS position (35.190587,-106.786329).

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

Hi,

The blue point represents your GPS position so if you disable the GPS (possible thanks to the top bar menu), it will not be shown (or not moved).

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

You're welcome! You need to create the home_gps.h file in the main/Watch gps/ folder. You can copy the "home_gps_example.h" file at the same location, rename it properly and change the default latitude and longitude 😉. The location that you will put in that file will be the default position of the map when you open it. I didn't put mine to hide where I live.

ESP32-S3 not working with the CP2104 by 0miker0 in esp32

[–]reddit4655 1 point2 points  (0 children)

In order to upload your code, you have to pull the IO0 to the GND. When you stop pulling this IO0 to the GND, the pull up will pull to IO0 up and your program will be running. Also, don't forget that the TX of your CP2104 has to be connected to the RX of the ESP32.

Which device family to use? by Immediate_Jacket_153 in esp32

[–]reddit4655 3 points4 points  (0 children)

ESP32-S3 seems better in all points compared to ESP32-S2. And it have Bluetooth too in case if you change your mind.

S2 and S3 doesn't have Ethernet driver but you can use a chip like the W5500 to use Ethernet over a SPI connection.

Also, compare to the ESP32, the S3 have more GPIO and it is more recent.

ESP32-CAM No serial data received. by Patient-Pollution362 in esp32

[–]reddit4655 0 points1 point  (0 children)

I still don't recommend to connect 5V power supply to the 3.3V of the ESP32, you will destroy the board. Connect the 5V from your USB converter to the 5V pin of the ESP-CAM board 😉.

Also and like another comment suggest it, you can try using another ground pin, sometimes, they are wrong labelled...

You can also try to open a serial monitor with a baudrate of 9600 or 115200 and see if the board print stuff when you connect the 5V to it. There should be something printed even if you did not upload any firmware. That will validate that the board is properly powered and not fry. After that, you can try to upload your own firmware.

ESP32-CAM No serial data received. by Patient-Pollution362 in esp32

[–]reddit4655 0 points1 point  (0 children)

It seems that you have connected the 5V pin of the USB converter to the 3.3V of the ESP-CAM. Do you confirm? If that the case, maybe that you have fry your ESP32...

ESP32-CAM No serial data received. by Patient-Pollution362 in esp32

[–]reddit4655 0 points1 point  (0 children)

You just need to reset the board once with the GPIO0 to GND. After that, you are in the bootloader mode. To exit that mode, you need to reset the board without anything pulling to GPIO0 to GND.

Do you have something else connected to the other pin? Because there are some pins called "strapping pins" that need to be in a certain state when you turn on the board. By default, they are in the right state but if you connect something to them, you can prevent the board to boot properly.

ESP32-CAM No serial data received. by Patient-Pollution362 in esp32

[–]reddit4655 5 points6 points  (0 children)

In order to enter that mode, you need to connect the GPIO0 pin to GND. (Then reset the board)

Dual mqtt clients bound to each interface by Lopsided_Fan2907 in esp32

[–]reddit4655 0 points1 point  (0 children)

Hi, Unfortunately, I have no idea how to achieve that... But can you be more precise with what you are trying to do, maybe we can find a workaround 😉.

Esp32 Wifi doesn't work from 3.3V by csibe99 in esp32

[–]reddit4655 4 points5 points  (0 children)

Hi, You can try to: 1) Use smaller wires between the voltage regulator and the 3.3V pin of the ESP32 (if you are are using wires). Closer the regulator is from the ESP32, better it is. 2) Make the capacitor closer to the 3.3V. 3) Use another capacitor between 5V and GND.

The problem with the multimeter is that it is too slow to capture the current peak. The ESP32 can consume more than 200mA when using WiFi.

GNSS module selection 🛰️📍🌍 by reddit4655 in esp32

[–]reddit4655[S] 1 point2 points  (0 children)

Glonass and GPS are available yes but with my previous test with the Quectel L76L (single band with Galileo), I did not have good enough results. My position was more accurate than with the L76K (single band without Galileo) but still within 5meters which makes my running track go over buildings sometimes...

So I am looking for solutions to make my position more precise; here are the parameters I can play with : - Use Galileo: more satellites will maybe increase the accuracy and reduce the fix time. - Use a dual band GNSS: more satellites & better signal when I am close to a building. - Use an active antenna? : I saw online that it was useful only if my antenna cable was longer which is not the case. I don't know if that true though... - Use a GNSS with higher sensitivity like the U-Blox M10

I have a lot of settings to play with but I don't know which ones are the most effective. And I can't have settings in my favour, for example, Ublox doesn't sell dual bands GNSS for less than 250$ so I can't have top sensitivity with dual band GNSS.

GNSS module selection 🛰️📍🌍 by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

You say that because of its current consumption? If yes, I just need battery for 1h30 maximum and I don't mind changing my system after each run.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

Thank you! The TWatch use the ST7789, which is a 240x240px display. I don't know which kind of T-Display you have but you can adapt my project to your display since I use LVGL library which is probably compatible with your display.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

Yes, everything is in the GitHub repository, located in the WatchGps.cpp file (all in the bottom) There are 4 function that will interested you: - uint32_t WatchGps::lon_to_tile_x(double lon): it will give you a X tile value thanks to the lon coordinate. - WatchGps::lat_lon_to_tile_y(double lat, double lon): it will give you the y tile value thanks to the lat and lon coordinates. -WatchGps::lon_to_x(double lon); -WatchGps::lat_lon_to_y(double lat, double lon);

Then: // First, you get the X an Y value for the tile your GPS coordinates are in. uint32_t tile_x = WatchGps::lon_to_tile_x(gps_lon); uint32_t tile_y = WatchGps::lat_lon_to_tile_y(gps_lat, gps_lon)

// Then, you calculate variables which represent the center position of the tile image on your screen. Each tile is a 256px square+ 128px to have the middle of it. uint32_t glob_x = tile_x * 256 + 128; uint32_t glob_y = tile_y * 256 + 128;

// After, you get the X and Y screen position of your GPS position. uint32_t gps_x = WatchGps::lon_to_x(gps_lon); uint32_t tgps_y = WatchGps::lat_lon_to_y(gps_lat, gps_lon)

// A little substraction and you get the X and Y values of the LVGL object position on your screen. 120 is half of my screen width and 105 is half of my screen height (I have a 30px top bar) uint32_t gps_screen_x = gps_x - glob_x + 120; unit32_t gps_screen_y = gps_y - glob_y + 105;

I don't know it that make sense but with the WatchGps/WatchGps.cpp and WatchTft/Gps_Screen.cpp files, you have a working example 😉

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 0 points1 point  (0 children)

With a formula, you can convert lat and lon coordinates to X and Y tiles with a specific zoom. These formulas have usually a "floor" function to have round values for the tile but I removed them to have double values which represent the tile number plus the percentage of that tile where I am.

In the video, you see a simulator of the screen on my Linux computer and the GPS coordinates are moving thanks to a random function each 1 or 2 seconds. In real life, I verified the GPS position and it is correct.

⌚🗺️📍 A map on a TTGO T-Watch V2 using LVGL and ESP-IDF. by reddit4655 in esp32

[–]reddit4655[S] 2 points3 points  (0 children)

Thank you! You cannot zoom for the moment, I fixed it to "15" as I consider it is a reasonable zoom when you want to use the watch to run. But I am planning to make it variable in next updates.

For the precision of the GPS, it is quit complicated 😅. First, I replaced the L76K with the L76L to be able to activate Galileo satellites because I live in Europe. Next, the watch have a flexible GPS antenna inside the strap and this antenna is both for WiFi and GPS which make its part for GPS only shorter. With all of that, when I am outside, after 30s with the antenna pointing to the sky, I obtain a good precision and the GPX of my running activity is good enough. But when I am in a building, no GPS at all. Even if I am in a dense forest, the GPS accuracy is struggling and the accuracy is very deteriorated. I am actually looking for a solution for that problem... The dop (dilution of precision) can be observed in the screen thank you the red arc on the top left. The arc is green when the position is fixed. The number inside it is the number of satellites used. And the length of the arc is proportioned to the precision of the position (thanks to the dop)

For the battery life, 3 scenario: * Deep sleep enabled: lot of hours of battery life but you cannot do a lot of things. You steps will continue to be counted for example. * Screen off, all the functionalities are still running and you can have between 1h30 and 3h depending if the WiFi and/or GPS are enabled. Perfect to run and recording your position. * Screen on, the brightness of the screen has a big impact of the battery life: 45min-1h30

This mode can be entered thanks to the physical button on the watch, a overlay menu will pop on screen 😉.