#407
HTML-код
- Опубликовано: 25 авг 2024
- Up till now, emulating a keyboard or a mouse was only possible with an Arduino Micro or a USB host shield. With the new Arduino support for the ESP32-S2 I will show you how it can be done with our darling. In addition, we will add Wi-Fi to create remote logging to Excel or other PC software. If you have evil thoughts, you can also use it as a wireless “rubber ducky” to hack other PCs or play a trick with your colleagues. As a bonus, we will deepen our knowledge of how USB works.
I am a proud Patreon of @GreatScott!, @ElectroBOOM , @Electronoobs , @EEVblog , and others. No Docker, No Microsoft Teams, Zoom
Links:
FeatherS2: amzn.to/3BV6uWJ
TinyS2: amzn.to/3BQ96Fm
ESP32-S2: s.click.aliexp... or amzn.to/3ETmQkz
Arduino Pro Micro Clone: s.click.aliexp... or amzn.to/3CSm1rU
Github: github.com/Sen...
The links above usually are affiliate links that support the channel (no additional cost for you).
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com...
My Patreon Page: / andreasspiess
Discord: / discord
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission of your purchases to buy new stuff for the channel
My Amazon.com shop: www.amazon.com...
For Banggood bit.ly/2jAQEf4
For AliExpress: bit.ly/2B0yTLL
For Amazon.de: amzn.to/2r0ZCYI
For Amazon UK: amzn.to/2mxBaJf
For ebay.com: ebay.to/2DuYXBp
www.facebook.c...
/ spiessa
www.instructab...
Please do not try to email me. This communication channel is reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases
#no#midroll#ads Наука
Regarding the CONFUSING pin numbers: It's better not get frustrated, just stay calm and continue. By FAR, this is one of the #1 lessons I have learned from you Andreas Spiess. Thank you.
:-)) Thank you!
Comes right around the perfect time, I want to make a Kerbal-Space-Program Keyboard as an Xmas present for my brother.
It's like your reading my mind :D
Whole Keyboard o_O
Cool gift. You are a good brother!
I must thank you, so so much! Ironically, your thumbnail is showing a keyboard i was waiting from Logitech for a few years already! What an irony... now i can sit in a first row and keep lights off :)
Very good! Illuminated keyboards are coo!
Thank you Andreas. I’ve used that JTAG block in the ESP32-C3 @
3:53. Allows JTAG debugging in VSCode, using the USB data mode-without a JTAG probe. Uses a risc-v debug standard. Used the ESP32-C3 dev module hardware.
Thank you for the information. So far I only debugged the original ESP32 using PIO and it worked ok, too.
A basic ESP32 can be a HID through Bluetooth.
Even better than use a USB cable and you can use it on a phone or tablet.
Try that on your run-of-the-mill pc, it won't have Bluetooth, so this is valid as well. I just wished this had Bluetooth as well to be the best of both worlds.
@@RicardoRibeiro-dorcari USB dongle.
@@viniciusnoyoutube sure, but why do it if you can connect with usb and get power at the same time. There are use cases for everything so both approaches have their merit.
@@RicardoRibeiro-dorcari Who says otherwise?
@@viniciusnoyoutube ...if they work. I've got a sh*tton of different USB BT Dongles and none of them works with all devices.
As always, the video was very interesting! I follow your channel to stay updated with the latest technologies and to find inspiration for future projects. Great work! Thank you. :)
You are welcome! I am also interested in those topics. This is why I still like to create those videos.
LoL... was trying to get all the information together to make something like this... here it is, all in one video!
Much love.
Glad it was helpful!
Awesome as always. Thank you for the effort.
You are welcome. It took a long time till the software support for this chip was available (for the Arduino IDE)
Thanks Andreas for your explanation of the HID requirement for Keyboard emulation.
You are welcome!
Sir I have recently found love in electronic trying to build a custom keyboard. Your video cleared up so many questions thank you
You are welcome!
I love u andreas! You are the rockstar of the microcontroller. This video help me a lot. Big hug from argentina amigo!
Thank you for your kind words!
11:49 so, it could be theoretically possible to make something that downloads a file (maybe from the Synology?) and make it available for example to a 3d Printer without network capability? Sound like another thing for the Endless list of projects.
@@ruakij6452 Octoprint is currently not supporting SLA (resin) Printers unfortunately. Nanodlp might work, would have to look into that. But a usb dongle that can connect to a NAS and let it automatically download from a certain directory could be neat for other stuff too.
Or even Cooler, the Other way around! Plug the USB Stick into the PC/Machine/Device and put your files on it. always connected to the WiFi AP/Hotspot. And make them available to other computers/servers.
Because this "Sandisk WiFi USB Stick" or all other stupid USB Disk with WiFi cannot use USB mode and WiFi at the same time.
This might be possible in theory, but the throughput of the USB OTG interface is limited to USB1.1-FS - that's 12MBit/sec. (USB2 is 480MBit/s)
Using it as mass storage might be limited by that...
@@bastiannenke9613 I'd imagine octoprint would support a laser based SLA though? Since you can still convert standard G-code with the correct firmware. (Here's hoping because my janky DIY SLA needs some luck)
@@SuperBootyBay my resin printer doesn't use g code, I't has a picture for every layer. Which is as far as I currently know not supported.
Excellent job 👏thank you Andreas always interesting technology to learn and discover. Suggestion any Pi Pico projects with USB HID. Cw or Wspr beacons thanks again
So far I do not see that the Pico has got a lot of traction in the Maker community... But it for sure could be used for that purpose.
I do not see where USB would be of benefit for beacons :-(
It's been a long time since I tinkered with USB, but I think you can have both HID and CDC configured. They will then both enumerate and show up as 2 USB devices..
I think you ae right.
General remark: Das USKA Seminar Antennensimulation vom 13.11.2021 hat mir gezeigt, wie schwierig es ist derartige Themen darzustellen. Umso mehr bin ich begeistert von der Qualität Deiner Videos, simply outstanding, out of this world.
Danke und: Ja. Einfache Videos sind nicht einfach in der Herstellung und brauchen Zeit.
Wenn dich Antennen interessieren empfehle ich mein VNA Video. Oder das SDR Grundlagenvideo sei auch gut sagen die Zuschauer;-)
Another great useful video. Thanks Andreas for diving deep into the ESP32 and saving us so much head scratching.
You are welcome! This is the goal of this channel ;-)
gorgeous job was done here! thank you!!
You are welcome!
Great update video as always
Thanks for sharing your experiences with all of us :-)
My pleasure!
Evil thoughts... not really, but playing a few tricks on colleagues... defenately. Great video and USB overview.
Post e message on screen. With notepad or terminal. "this is a ransomeware put your hands in the air where I can see them"
I see both of you have a lot of ideas :-)
@@AndreasSpiess Indeed, lot's of ideas, but so little time (and money)...
The Leonardo is able to emulate a HID.
Leonardo is same as atmega32 or Arduino Micro
and it has native USB peripheral
You are right.
So great as always !
Thank you for everything, I do learn lot of things from you ! Thank you so much !
Happy to hear that! You are welcome.
I bought a pile of attiny85 chips some years back as they support v-usb, great for adding a few external switches to a PC via USB and really cheap
Good idea. I love the ATTiny85! But it has a very limited number of pins. If you use 2 for USB you do not have a lot left to connect switches etc...
@@AndreasSpiess Just a note that v-usb works with any Atmel MCU. It is just software emulated USB. It only does the slower USB 1.1, but that is what keyboards and mice use, so perfect. In some ways, it is superior to hardware, because it is inexpensive, and you have complete software control over everything. Also, it doesn't consume a serial port, leaving the serial port free for other things.
Very interesting, thanks!
Glad you liked it! As you saw I also learned a few things in this video ;-)
OBS controller with wifi ui to create new combinations of keyboard shortcuts! Idea is born :)
Good idea. So far I only did some experimenting with OBS (because I do not do live streams)...
Super nice Andreas - as usual. I prefer S2 over S for all my sensors (however S2 bare is a bit longer than S bare - I don't use dev boards at all - too big for real application). Also S2 has lower power consumption both while working and while sleeping. Since I don't use BT I am not missing anything. And I love Arduino version 2 (although still beta) ;-)
I use version 2 of the IDE from time-to-time to check it out. It still takes a long time for startup which I do not like for my small projects...
@@AndreasSpiess you are right, but once it's started, everything after is a pleasure ;-) Especially that the serial monitor is built in ;-)
😊
Excellent video 👏
Thank you very much!
6:34 good use of the word crap :D
:-)
Good to know! Wonderful USB noice cancelation explaining!
Thank you!
Greatings Andreas from Venezuela. I will try later when i get my new esp32 in a few days.almost christmas for me. Byeee
Enjoy!
Once upon a time I wired an Ethernet extension by splicing into the USB cable of a low res webcam (0.8 or 1.2MP, don't recall).
It worked great, was able to watch the webcam from 50' away and catch thieves picking their nose while going through/messing up/stealing from my workstation. USB 1.1 != USB 2.0
I did not check the limit of USB1.1. It seems it was more robust (maybe because it was slower than USB2.0)
Thank you Andreas, this is the topic I am also after! It is good to know they have added these libraries to Arduino. Before this, only ESP-IDF had it, and it is a terrible mess for me who has got used to Arduino framework. The next step would be USB OTG. Use the ESP32S2 to READ USB devices. (Mouse, keyboard, PS controller, etc.) Is it possible? I have read the ESP also has this functionality, but cannot find any example code of it. :(
Then you need the real "host" library. But I do not know if it exists (was ported) for the -S2
Great video as always! Any plans to play around with C3's coded phy long range mode? Almost LoRa range, convenient BLE functionality and very reasonable power seems almost too good to be true...
I already did a video about the Long Range mode of the ESP32. It is not comparable with LoRa at all.
My idea is to build a keyboard converter between Mac and Windows which send C to my Windows when I use the Mac shortcut.
is STGR the key on the bottom left? I now want a STGR keycap for my keyboard. :D For other people: is what german keyboard says for
@@DoctorWhom yes I mean this key. As a Mac user I often press COMMAND key which is Windows or ALT GR key for Windows when using remote desktop.
Thanks!
It was really interesting
Glad you liked the video!
Excellent video. Thanks Andreas.
You are welcome!
Thanks for the video!
You're welcome!
Balanced audio cables (typically XLR) used a similar EMI reduction technique. Very simple but very clever.
They can do, but differential signalling (what USB does) isn't the same thing as balanced signalling. The former has a single signal transmitted down two conductors, with one being of opposite polarity, whereas balanced signalling has two conductors with _equal impedance_ to ground, one of which carries the signal, and the other being possibly 0V. You can use both together, but they're different.
With balanced signalling, you subtract the noise line from the signal line to get a clean unbalanced system, which is possible as they're of the same impedance, whereas with differential signalling, you invert one of the signals and average them.
Differential signalling helps eliminate things like crosstalk, whereas balanced signalling is more about noise reduction though the elimination of common-mode interference.
@Keith: Thank you for your deep insight!
2:23 I'm surprised you didn't mention the Teensy. It's supported this in the 4.1 board. The code implementation could use some better examples. I just picked up a Feather S2 to do the same thing. I'll have to give this one a go too.
You are right, the Teensy's and many other STM32 boards offer native USB. A big Teensy is probably an overkill for most of those projects...
@@AndreasSpiess Agreed. Teensy is overkill for a lot of small IOT projects plus it lacks the wifi. Like you I was pretty excited to see the host mode on the device. As more of these are produced the cost will go down and I'm really looking forward to the S2 when its in the sub $10 range like the ESP32's.
Wow, the ESP chips are so versitile! There are much more capabilities than I have time to play with them
Agreed. Still good to know if we need it...
Excelente. Congrats !!!
Thank you!
The same 'differential' two wire signalling is also used in RS432 and RS485 serial connections.
You are right. This is a widely used principle.
Thank you, would be great if you could show how to work with the TTGO version as well, how to use the screen and the dip switches.
Thanks again
This is probably too specific. If you look at the diagram you see that they use the ST7789 display (there is a library available) and one dip switch is to change the USB connector to between the USB-to-Serial chip and the ESP (GPIO19/20). The second dip switch is for the XTAL pins. I do not understand the purpose and did not find documentation :-(
@@AndreasSpiess Thank you for your reply,
in the product description, it says ST77789. But I tried with ST7789 and did not manage yet. Will keep trying :)
Thank you for this video. It's so sad that the Teensy-Boards don't come with wifi. I really like the keaboard and joystick capablilities of Teensy-boards.
This is why we all love the ESPs: They have Wi-Fi. It took other manufacturers a long time to understand and follow. This is why Espressif became so big... But the Teensies have their areas where they are good.
Andreas ! love your videos, been a fan for years now. I would just like to point out, maybe for clarification in the beginning of the video, that you are specifically talking about USB keyboards - since you can still make ESP32 based Bluetooth keyboards without issue and people may get confused !
I thought this was clear in the title ;-) But pay attention: The -S2 does not offer Bluetooth.
@@AndreasSpiess I had no idea! thanks for the clarification.
Thanks, Andreas!
I think a very needed application of USB keyboard for ESP32-S2 is a convenient way to supply user/pass pairs to the MCU (for Wi-Fi, etc.), instead of hard coding them in C/C++ files. For home project it's good, but for industrial it isn't. Passswords can change on a regular basis. A board, that holds a chip, can have a service pins to attach a standard USB-A connector. That, in turn, connects to USB keyboard. A LCD screen for key echo is optional.
In my lab I use a password manager for the purpose of filling in different passwords. So I would not need an external device. But you are right, in other environments where such managers are not allowed it would be handy. You could create a database with the different passwords and call this database before you enter the credentials automatically...
Thanks for the great video!
Glad you liked it!
The Arduino family has two boards that can emulate USB, Arduino Leonardo and Arduino Micro and both is using the MCU ATmega32U4. So its the ATmega32U4 that is the enabler for USB host functionality.
You are right. The Leonardo is more-or-less the same as the Pro Micro. Just bigger (and more expensive). The Due, BTW, also supported native USB.
@@AndreasSpiess Ok, I haven't played around with that one, but then we can add the ATtiny (ex Digispark) family as well ;-)
And I must say THX for all your inspiring Videos.
I would put the ATTINY in a different category because it uses bitbanging and has no native USB...
@@AndreasSpiess Agree
Interesting and I agree with the comment around 6 minuit mark, altho it can be hard to stay calm when the ' official ' PDF uses a 4th numbering system ( the actual pins on chip )!
The pin numbering usually has to be different because of technical reasons. This is acceptable. The rest is a pain in the ...
You can also try "USB Firmware MSC on Boot", which will add a new MSC drive which gives you access to the running firmware bin and allow you to upload a new firmware (requires partitions with OTA)
Thank you for the info!
'Make sure you have ver2.0.0' , here is me staring at ver1.0.6. Never mind going crazy at keyboard stuff :-)
Check if you have the newest string in the preferences tab. Maybe they changed it. I do not remember.
@@AndreasSpiess I have been upgrading the Arduino software from my fathers pc. The installation of that software was way before 2013 because I still see my fathers projects. I may need to do a full install from scratch. My father passed away in 2015 btw. Time is moving fast, to fast, it seems. To bad he can't contribute to the community anymore.
Sorry to hear that you lost your father early.
Yes, you need to be on the newest version of the IDE. A new install should not be a big issue if you do not messed with the core...
Thank you 🙏 always enjoy your video’s
Give me some ideas to add some work from home automation( switch on / off mic for video call + windows blinds ect ) …
Sounds great! If you have a lot of video calls.
Puh, you must have been stuck in editing quite a while 🙈
Thanks Andreas :)
All my videos take a long time for editing ;-)
Can the Joystick library be adapted to work on the ESP S2? I have my Sim Racing Pedals running on a Arduino Micro, would be great to make a Wireless Button Box or Shifter Too.
I assume it could be done. But I never tried.
I have 4 of them hanging around. By the way, busy day tinkering with solar and earth stake as well.
I saw on RUclips that you are busy ;-)
The next project idea is to build an ESP password saver, that types in the required password when connected with PC
Get an Attiny85 usb board
That would be possible. However, a password manager is probably an easier possibility for that.
Using an ATTINY would mean that you always use the same passwords ;-) Change means re-programming, I assume.
Love your work sir
Glad to hear that!
Me: I understand how this works.
Andreas: Errr. Not quite so.. let me explain.
:-)
A good idea for us office workers who're now working from home due to COVID: a "mouse jiggler". Got an Arduino Leonardo/Micro compatible board with a small form factor, basically a stamp with a USB connector built into the PCB that slots into any free USB port, to move my mouse one pixel diagonally and back every minute. This way, my PC doesn't log me out every time I take a toilet break.
And yes, before anyone comments: I know this is against security best practices. But I live alone and my doors are always locked, even when I'm home, so it's not like anyone can get physical access to the laptop while I'm briefly away from my keyboard. At night, when I step away from the machine for longer, or when I leave the house, it gets logged out.
A good idea if your PC policy is so strict.
You can install a small executable in the pc (I made one in Delphi ) that simulates a mouse that move...and thats all, you don't need a hardware for this!
@@teixeirarg That's great on your own PC where you have full admin rights. But if you have full admin rights, you don't need it as you can just disable the automated screen lock.
With ATTiny85 is also possible, even there are Attiny85 modules with the USB connector to be programmed as external keyboards to automate tasks. Thanks for the video, maybe I'll buy an ESP32-S2 to test it. Can be useful to create bluetooth dongles to connect PS3/4 gamepads for example, without the use of external softwares that sometimes fails.
Unfortunately, The -S2 does not offer BLE :-( The ATTINY85 is a cool chip. However it has not many pins left in this scenario...
Cool video, keep it up, thank you :)
Thanks, will do!
Hello Andreas, this is very interesting, as usual. I'm a bit confused about 2 points :
First, how do you connect the D+/D- pins on a PC ? Do you split a USB cable ?
Other question : Why shouldn't you use the VCC/5V/3.3V pins ?
Cheers
at (6:24) he shows a MicroUSB Breakout connected to the pins and then its just a normal USB cable you plug in.
The Host (PC) provides 5V to power the Peripheral so plugging it into 3V3 would kill the ESP as its just running on 3V3 (which it has a regulator on board.
And depending on where the "normal" USB connector is connected to it may have a different potential which might kill your USB port in the PC, just the USB function in the ESP or the whole ESP.
@@StreuPfeffer thank you, very clear.
@@emmanuelr6698 Don't forget the GND (it is shown in the video briefly, but you need 3 wires for the USB: D- D+ GND)
@@StreuPfeffer Hi, quick question: It is that you don't plug into the 3.3V and 5V to supply power (because the by passes on board voltage regulator ) to the board but you can get 3.3V and 5V out of the board that way, correct?
@StreuPfeffer: Thank you for answering the question.
@jedidiah paterson: Most boards have a 3.3 volt regulator and a pin to use 3.3 volts for other components like sensors.
Good stuff!!!
Thanks!
Well, the STM32F103 (or better) has been around for quite a while on the bluepill dev-board and has native USB hardware.
Also I think some Uno boards have a 16U2 or similar native USB MCU on them for programming that you can reprogram yourself via the ICSP header.
Either way what I care about is cost. I’ll look into the ESP32-S2 if they’re cheaper than a (legit) STM32.
If you’re really looking for something cheap then the CH55x series MCUs provide native USB for a low cost, but they’re 8-bit not 32-but, and I haven’t seen any good tool chains for them yet.
I agree that many STMs also have USB. And you can reprogram the 16U2. But it is a pain in the ... Most projects I saw used the Pro Picro. This is why I mentioned it.
Here's a seemingly mundane idea, an ESP32-S2 based Smart Keyboard, possibly QMK compatible? They're so powerful and cheap it seems like a no-brainer to use as the core of a mechanical keyboard you can add additional features to. Something similar to the old Logitech G series but open FOSSware?
I am not in keyboards, so I do not know if such a project already exists.
@@AndreasSpiess I only found one in my digging, "Sanctuary", not on the S2, and they didn't take full advantage of it's capabilities. In theory it shouldn't be too hard on the hardware-side, it's just a big 70-button input matrix, but it's the software that's a hitching point.
Update for those who find this post: A newer keyboard software project has taken over support for the ESP32-S2. KMK, it's basically QMK in Circuit Python. A little harder to figure out going in blind, but it works all the same.
My google skills failed me and I couldn't find any information on why certain esp chips (esp32, esp32c3, etc) do not support circuitpython. it's because those chips don't support the advanced usb modes such as hid/storage. Thank you!
You have to ask Adafruit. I do not know :-(
Look at the Teensy 4, can do a lot...
True. But no Wi-Fi :-(
@@AndreasSpiess you can use a wifi dongle or a bluetooth dongle on the USB host port
Great video, as always! Have you been able to get some real world data regarding energy consumption of the ES32-S2 with wifi during light sleep? As ESP-NOW uses the wifi library and hardware, I assume using it should also be possible during light sleep. But would be great to have confirmation. :)
Same answer as before :-(
@@AndreasSpiess Sorry for double posting. I discovered this video after my previous comment and thought it'd fit better here, so more people can find it if they are interested in the same topic. :)
BTW: after watching all of your board comparison videos, I'd encourage you to try more olimex boards. They have lots of ESP32 variants. Many have battery chargers, use extremely little energy in deep sleep (e.g. 20µA for the ESP32-S2 variants) and most are also sold as an EA version with an external antenna. Including the one you already tested. So you could update the google docs list with a new board, without even having to buy and test a new device. ;)
The next most useful functionalities for a USB host would be the integration of drivers for USB serial converter such aus FTDI CP2102, CH340. Example: Adapt Zigbee Sticks, ZWave Sticks etc. These Sticks use USB to be connected to a Raspi or a real computer. But if your computer with the home automation system is in the basement and not at the place of best RF reception? Then you need a bridge between these USB devices and your computer via LAN/Wifi. You can use a Raspi for that. But maybe the ESP32 could do the trick also?
Zwave forms a mesh network so reception is not much of a problem as long as the Zwave stick can communicate with at least one client, this will repeat signals to other clients in range.
So far I did not see such a project. But technically, it should be possible. But it probably needs some knowledge about the Zigbee or other stacks.
The mesh functionality can help to overcome bad connections, too.
@@AndreasSpiess sorry, I was not clear enough. These Sticks typically include a FTD or CP2102 or CH340 as an USB interface. So what is needed is a Driver for these Chips and a bridge to LAN Wifi.
I solved this issue by a HW modification and an additional piece of HW. Works well, but if the ESP32 has USB host, a direct SW integration would be nice.
Aha. You are right. But did you see a host implementation for the ESP32?
In this particular case, it looks like it's possible to connect a webcam via USB, right? I plan to put an endoscopic USB camera on the ESP32-S2 and turn it into a local IP camera (local webserver cam - Livestream). it is possible?
Espressif's home page says: "With its native USB interface, ESP32-S2 can connect to a camera that supports USB Full-Speed mode"
@@AndreasSpiess Thank you very much, very good to know that this is possible. I just need to find now how to do the whole process.
hey andreas i have ordered a esp32 S2 solo devkitC-01 development board . i want to ask that will this work as a hid keyboard like arduino pro micro plzz answer
It should work.
Hi Andreas,
You just reminded me of the mouse code I played with on a Teensy4.1
It moves the mouse in a triangle when plugged into a pc.
Being small it is easy to plug in and hide.
Can be disguised as a flash drive very nicely.
And it creates major chaos, guaranteed.
I enjoyed this video, quite applicable to evil me.
Thanks for making and sharing.
Kind regards,
South Africa
You are right. The teensy and some STM32s have USB, too
Maybe you can use this as an "invisible" wifi keyboard logger.
That would be the other way round. I never saw such a project with the ESP32-S2
Hello Andreas, you're video was great! I just have one question. Can the esp32-s2 emulate the mouse clicks wirelessly over wifi?
If you want to connect a mouse to the ESP32 it has to support host mode. Which seems not to be the case for the Arduino IDE.
Couldn you create a Pair/set of wireless usb extensions ?
The ESPNOW function creates a Mesh network, and a Master Keyboard Plugged into USB Host of one device transfers keystrokes simultaniously to all connected clients,
or the opposite way round, create a wireless USB Hub, where multiple Wirless Devices as Connected to a Host PC, now able to access them wherever they are (inside your network)....
or you could create a wireless barcode Scanner, one device enters the data into your pc, one ESP Cam scans the qr code ;) ?
Good ideas if you have a use case for them. I do not own a lot of PCs ;-)
Teensy 4.1 has had this capability since it was introduced. It has two USB ports, one is used for programming connected to the PC and the other as a USB host. Many people have been using it to simulate mice and keyboards.
By the way it is also equipped with hardware ethernet and it runs at 600mHz.
Have you used the one you received many months ago? You said you were going to experiment with it.
You are right. I had it once in a video. It is a beast! I would call it an overkill for such a simple application.
@@AndreasSpiess I agree, but what have you done with it? Is it sat in a drawer all ignored or worse still gone to landfill?
Very nicely explained. I have a question can we interface USB barcode scanner directly with ESP32 ?
You get barcode readers which emulate a keyboard. They should be ok. Maybe you fond also readers with serial connection. That would be easier.
5:42 LMAO😂
One more great subject to learn from your video. Thank you.
My pleasure!
You havent put the video numbers on some of your latest videos. Dont know if this is intentional or accidental, just letting you know. :-) I really like your videos , great work.
Always the last ten or so have no numbers…
Sometimes it could be very difficult to send text to EXCEL, because some hidden softwares get instant focus and correctly restore quickly focus, but sent characters are lost of EXCEL and addressed to some hidden programs.
True. It is not an ideal solution. More a "quick and dirty" one.
Leonardo was USB capable too
You are right. It is more-or-less the same as the Pro Micro. Just bigger (and more expensive).
I experimented with building a bluetooth keyboard emulator with a ESP32 Huzza32. I want to have two rotary knobs connected wireless and I got it somewhat working but not without problems.
Do you think the -S2 version of ESP32 also affects the BLE routines for building a keyboard emulator?
S2 = no BT I think
Zygfryd Homonto is right: The -S2 has no Bluetooth.
The only problem is that the emulated keyboard device stops working after the host awakes from sleep mode. I found out when trying to use an ESP32 S2 to login into my Win10 box when it gets a message over MQTT. Also there's no Power Management tab in the device settings where one could enable "Allow this device to wake the computer"
I never tried it in this configuration. I assume you need a lot of USB know-how to debug this one...
I have a project using a USB barcode scanner through a USB host shield board to an ESP32 Devkit board. it reads the information as a keyboard and compares a scanned code against a desired code. but it is too slow for some of the more modern scanners and I need to find a way to read through the dedicated USB is there an example as I cannot find any.
First I would ask myself: Where is the bottleneck and where do I lose the time...
I have learned a lot from your videos, sitting in the first row, and I finally have a question. Since I can not seem to get Arduino IDE working on my machine, which of the many IDE’s will allow me to run this code?
ESP-IDF is the native compilation and flashing toolchain for Espressif's chips and the boards which host them. However, you will not simply be able to copy over the code.
Many people use PlatformIO or Visual Micro. You find videos on both on this channel. AFAIK both depend on a working Arduino IDE on the same machine.
Sometimes I use a little Leonardo to keep my pc alive, by injecting a little jump as a mouse.
The Leonardo is similar to the Pro Micro. So you are right, it always had USB suppoer. But it never became very popular.
As usual an excellent video. Thank you. When using the ESP3D lib to communicate with a 3D printer via WiFi using a standard ESP32 it is necessary to hack the printer motherboard to get access to the serial port on the other side of the USB chip. Will it be possible to connect it directly to the USB port if you use the ESP32 S2 ?? (Mabe a project for you to do ?)
It might be possible. I would ask the project because I assume it would be interesting for all users. Maybe they even tried and it did not work?
Thank you Andrea, I was enthusiastic for the emulating keyboard function and therefore I developped my own application however the emulation doesn't work during notebook boot (e.g. to modify BIOS setting). Other USB external keyboards work as expected. Any idea?
I do not have enough USB know-how :-(
Very nice video! Thank you. I have some Espressif ESP32-S2 WROOM at home, will they work for this? I think you are using the WROVER ESP32-S2
no difference - on Arduino you choose "ESP32 S2 Dev Module"
@@zyghom Thank you very much!
6:50 "Because I'm now used to this crap, I stayed calm and continued" Ah, yes, the right-of-passage all successful tinkerers' and makers must go through when working with such boards.
Indeed!
USB has been around for a very long period yet not many micros support it natively. Of course, esp32+USB will be very useful. Wifi disk might be useful to change contents while actually being read/written over wifi. or maybe a USB webcam? or maybe simply a wifi keyboard for ancient pi. but the USB protocol looks very complicated and looks like i don't have the s2 version so i have to watch only on youtube.
or maybe make special devices and write drivers on linux like in this series: ruclips.net/video/NYRhkGrt4Q4/видео.html
Another user gave me the tip to use the USB disk on the ESP32-S2 for programming. And really, if you place a new bin file on the drive the ESP reboots and starts with the new sketch. Cool! If Arduino would support the copying of the file directly to the disk this would be a very fast uploading possibility. Without programming. Just selecting the "MSC" option before uploading the first sketch.
yes usb disk to place code would make the process COOL!
Hello! A question, why do you need to add another usb connector for windows keyboard function?
Thanks.
Marc.
As I tried to show in the video, the native USB function is not connected to the USB connector.
A while back I used a Teensy(???) to replace the brains in a keyboard. A nice feature I added were non-keyboard modes. Like I could double tap F1 to make it act like a mouse I could move by pressing and holding keys so that I didn't have to keep taking my hands off the keyboard to move the mouse. More recently I used an ESP32-S2 and sensor fusion board to make a joystick. I want to put it in a case that looks like a Star Trek Phaser but my FreeCad skills weren't up to snuff to modify a downloaded 3d model of one for 3d printing.
If you do not need Wi-Fi you have other possibilities as the Teensy, I agree. For most of those simple applications it is probably an overkill compared to a Pr Micro clone. But otherwise it is a nice chip. And downloading models is much faster than creating one. I also do this from time-to-time
Thank you Andreas,
Your videos as always are very useful.
I have lots of traditional ESP32 chips (without USB support) -
Please can you propose the easiest hardware solution to make them read data from USB devices like USB-GPS dongle?
I tried to connect them via USB-to-UART converter, but for some reason it didn't work.
I suppose the trick is that USB-to-UART converter supposes that HOST is on USB side, and DEVICE is on UART side,
but in case with USB-GPS dongle we have DEVICE on USB side, and probably this confuses to converter chip?
How we can transmit/decode data properly from DEVICE on USB side to HOST (ESP32) on UART side?
You should find USB host adapters for Arduinos on Aliexpress. They should work also with the ESP32.
@AndreasSpiess Thank you, Andreas!
Ah, the German QWERTZ keyboard? I discovered that way back when I tried to use a German keyboard layout so æøå would give ëöä instead..
I nearly forgotten that the keyboard is not independent from the operating system. Which is unbelievable in today's terms. One would expect that the keyoards transmit Unicode letters. But standards are hard to change...
Please create video about Expressif RainMaker
Why do you think?
Great info - thanks. Any idea how I could emulate a USB Midi device with the ESP32-S2? I don't see MIDI devices mentioned in the arduino-esp32/libraries/USB library.
Give CircuitPython a quick look, see if they support MIDI on their ESP32-S2 port. Their docs that MIDI is disabled by default on the ESP32-S2 build as there is limit of device endpoints. At the very least you can see what they are doing in their code to talk USB MIDI
@@DoctorWhom will do - thanks.
The Arduino IDE also supports Midi. So it should work with the ESP32. But I am no musician :-(
Corning Fibre Optical USB cables can be up to a mile long.
How much is that :D
You are right.
Great video again! Any idea how to simulate a "wake-up" by the keyboard, so I can wake-up my Windows box remote?
For me, hitting a key like spacebar works for a wakeup, so it should be possible to send the needed key (possible differences for Different Mainboards)
You can search for wake on LAN or WOL. You just send a magic byte and the PC starts
If you selected the "Power On by Keyboard" option in BIOS then Waking up with Spacebar should work!
@@Haldi4803 thanks, I will try that. But there should be a possibility to set the power (on) action in the device manager for a HID keyboard. But for The EPS32-S simulated keyboard the power control tab is not available there.
Thank you, good as always, maybe you should be a bit slower and more detailed in some areas, may be a bit fast for new users
You are right. This channel is not very good for beginners. Fortunately, RUclips has a replay function (i use it a lot when I encounter a problem I do not understand ;-) )