Hacker News new | past | comments | ask | show | jobs | submit login
Liberating Wi-Fi on the ESP32 [video] (ccc.de)
326 points by doener 8 days ago | hide | past | favorite | 129 comments






I would like to submit that making the open source version compatible with the closed source API might be an asset.

By being compatible, users get all the benefits of the existing corpus of help on the internet. And being compatible make the cost to entry lower. If somebody wants to make a very small modification of the MAC layer, they can do it as with the closed source and just go behind the curtain and file a little the thing they want to hack, without the cognitive load of learning a new API.


Author here; see also the entire series of posts on https://esp32-open-mac.be/

Still super weird that Espressif is the only company that managed it to get a Wifi modem into a more or less decent microcontroller.

ST still far behind when it comes to this stuff.


Other examples:

- BK72xx Ex: BK7231T, BK7231N

- RTL87xx Ex: RTL8710BN, RTL8710BX

- RP2040 But seems like the wifi is an extranl module in W boards

Taken from https://esphome.io


WiFi and Bluetooth for the Raspberry Pico W is provided by an Infineon CYW43439 (https://www.infineon.com/cms/en/product/wireless-connectivit...), which has its own ARM cores.

Beken modules are so weirdly cheap. I've seen them inside 2£ LED bulbs in discount stores.

They hit the right combo of cheap ($€), accessible (you can buy them everywhere, shipped everywhere, even in quantities of 1), easy to use hardware (they're sold on many different 'breakout boards' with usb connectors for power and programming and marked pins), easy to use software (documentation, examples, arduino ide, nodemcu) and without any weird limits licencing wise.

Arduino was similar at first, but stayed on low-performance avr chips for way too long and non-chinese ones were expensive (and well, no wifi), rpi pico has some nice features, but much harder to get at first, and everything else is a "raw chip" bought on sites like digikey, with expensive shipping, 600+ pages of documentation, 300+ of them needed to send a first ping, you need to solder them onto a board and programming usually requires some expensive rig.


Nordic semiconductor also has microcontrollers with BT and Wifi. They are much less common than espressifs solution though.

Fyi, while Nordic products are usually excellent, they did not design the wifi ics. They bought a company and slapped their name on the chips. I haven't used them yet, but from what I've heard they don't live up to Nordic's standard.

Edit: also afaik they don't have a mcu+wifi in one yet.


Because the prices are not competitive enough for hobbyists. How can you expect people to adopt and develop on top of your chips if they can't afford it?

BT/Wifi on a single chip? Do you have a part number?

That'd be revolutionary.

I love the ESP32. But they love (too much) current.


https://www.nordicsemi.com/Products/Wireless/WiFi/Products?l...

Search for the SiPs and SoCs, they all support BLE.


But these solutions require two chips, one for bluetooth and one for wifi where the ESP32 does it all in one.

Ah yes, you're right, I misunderstood their page.

Most TuYa-based modules on AliExpress are Beken.

TI has had wifi+bluetooth microcontrollers for almost a decade now, and you get a cortex m4.

Those are great in a professional context, but the CC3200s never had a <$10 Chinese breakout board.

And they're programmed in IAR or CCS instead of in the Arduino IDE, and they're programmed with an RTOS and the Cortex M4's powerful ISR engine instead of just a "while" loop.

ESP32/ESP8266 are basically optimized to be hobbyist-friendly, while most other wireless systems are not.



I haven't had chance to watch the video yet so apologies if this is covered, but are the ESP32 radios regulatory certifications tied to the official black box firmware? Would the same hardware but with open firmware need to be sent to the FCC (and others) again for proper compliance?

Yes, if distributed that way. No, if modified by the end user.

I don't remember the CFR off hand, but the FCC explicitly allows anyone to use small numbers of uncertified devices. It would still be a violation if those devices don't otherwise follow regulations, but using modified hardware or software isn't itself prohibited.


The power and directionality rules for ISM bands are good guidelines for not interfering with other's use of the band. If you have another story that makes interference unlikely, it probably also makes it unlikely to get caught. Plenty of items for sale on Amazon don't have any silkscreen on chips or boards, much less an FCC id. If they can get away with it...

15.23, but it applies specifically to "home-built devices", so I'm not sure if modification of a commercially available device would be within scope. Devices constructed from a kit are specifically excluded.

https://www.ecfr.gov/current/title-47/section-15.23


Are home-built devices allowed to be made using things like pre-manufactured valves and transistors?

What about integrated circuits?

Where's the line drawn?

Am I allowed to order some parts from Digikey and assemble them into a widget, or must I start closer to the beginning by mining my own ores?


If you can't make your own protons store bought is okay.

They excluded kits, because there was a thriving market for pirate radio station transmitters sold as kits.

This could change depending on the fallout from the current drone saga, no pun intended. Or other upcoming events.

Even if it's not FCC regulations, but some other agencies, there may be some close re-examination of what's allowed due to safety.

I'm guessing certain manufacturers are going to be impacted more than others.

I'm sorry for the uncertainty in boardrooms and garages across the world. I diversified my embedded sources but damn it's annoying.

But I suppose that's the machine.

I just picked up an ESP32-C6 for some mostly legal Bluetooth and maybe Zigbee experiments. I don't plan on hacking to this level, the Rust ecosystem is welcoming enough to make just building fun so far.

On a side note, I stepped in shit today. I know I have five q-tips in storage somewhere. And a few more in the closet. Sorry for the weird tangent.


Chevron being tossed also makes this all immensely more complicated

I'm sorry, yeah. It's more than boardrooms and garages.

I'm sorry to all.

Financial independence is just... it's nice having on top of other security and basic life guarantees.

Enjoy it while it is there.


I think it's a gray area. If I'm not grossly mistaken, only worst case radio performances are tested and documented, and the rest of required technical documents are more of rather detailed brochures like high level block diagrams and theory of operations than modern full design documents like PCB manufacturing files and firmware build scripts. They hardly acknowledge existence of firmware.

And there is at least one good reason: certified and unlicensed radio equipment, like Wi-Fi(or unlike HAM) are expected to be tamper resistant, for public good. And so last time FCC discussed certification requirements for Wi-Fi routers, they naturally considered extending it to software in form of mandatory Secure Boot - for every ultra vulnerable garbage Wi-Fi routers! That was a horrible idea and was scrapped.

For now, I think, IANAL, this is semi-legal or semi-illegal unless resulting firmware clearly generates out-of-spec emissions.


> And there is at least one good reason: certified and unlicensed radio equipment, like Wi-Fi(or unlike HAM) are expected to be tamper resistant, for public good.

This is such an own-goal.

The way manufacturers implement this is by locking out third party firmware. Then the device goes out of support a decade before people stop using it, but because nobody else can update it either -- and the manufacturer has higher internal support costs because there is no community submitting patches they could just adopt and ship -- the device gets full of public unpatched security vulnerabilities. Which at scale is a significant threat to national security. On top of losing whatever other benefits the public would derive from the community being able to fix firmware bugs or add features.

Meanwhile the purpose of the requirement is supposed to be to keep users from modifying the radio parameters to exceed regulatory limits. Which, first of all, hardly anybody is going to do anyway, because the vast majority of people don't even know how and most of the remainder aren't interested in risking huge fines just to avoid buying a second access point. But the people who are going to do it, because the devices don't get patched, can just use the vulnerabilities to root them and then modify the radio parameters anyway.

Which makes it a pointless rule that compromises the public good.


What you've said is why a lot of people voiced concerns to that suggested changes, leading to it getting safely cancelled, while the same cohort of people were and are fine with existing anti-tamper requirements.

I guess it's another anecdotal datapoint that shows disastrous state of the field called software engineering, especially relative to other professional fields of engineering(cf. https://xkcd.com/2030/).


The requirement also feigns innocence.

As far as I can tell there is no actual requirement to block third party firmware, merely a vague rule that says they have to do something. But designing hardware specifically to enforce the regulatory limits even if the firmware requests otherwise would cost money whereas blocking third party firmware just screws over the public, so in practice that's what they pick when you force them to check the box.

On top of that, using that method is also the least effective because then any firmware vulnerability still allows regulatory limits to be exceeded. And if you're okay with that then there are plenty of alternative measures that could be used to check the box at low cost as long as you don't care that they're not very effective. But somehow that's a failing for the alternatives whereas with software it's just expected to be rubbish.


Yes.


I had a cool idea for WiFi password provisioning once: it's possible to modulate the packet _length_ to transmit the SSID and the password. A new IoT device obviously can't decrypt the packets, but it can observe their length.

I even made a sample implementation for Linux. Unfortunately, I couldn't find a single IoT chip that would give low-level access to the PHY good enough for this :(


That's how TI's SmartConfig works, via the length field, so you could just use any IoT chip that implements that, of which TI offers a bunch.

Also supported by Espressif under their own name “Airkiss/ESPTouch”.

Unfortunately since the chip doesn’t support 5G WiFi it’s a mess where you need to switch the phone to a different 2.4 only network, configure the device, then switch back. Better to just use BLE..


https://www.keacher.com/xmas24/ uses OOK for data communication, with the benefit of energy harvesting the WiFi signal to not require batteries.

Reverse engineering as a last resort or is this not possible?

I'm no good at reverse engineering. I run away screaming in horror at the sight of Ghidra.

Cleaning up the Linux code and publishing it is on my TODO list...


Nowdays I'd just use WPA3

Side question. One of the speakers gave his DECT number. Does that mean people are still carrying around old phones just to use at tech conferences?

They operate several different networks for voice communications during the events. From what I found usually DECT, SIP, GSM. [1] They have a status dashboard with metrics during the events. [2]

[1] https://events.ccc.de/2024/12/22/38c3-poc-isdn-version/

[2] https://dashboard.eventphone.de/d/de7sgxz63vzeoe/38c3?orgId=...


Some years ago they also operated a pneumatic tube system.

Yes it's pretty handy for hacker camps. I still have one too. Especially because out on the camping fields the WiFi coverage can be hit and miss. This way you can even get calls when you walked to the toilet building or the car park.

Also it's got its own frequency so it's not cluttering the ones used for WiFi, Bluetooth, Zigbee etc.

I guess they could use an app or something but dect is rock stable and has much better range than WiFi.

I got a nice Siemens one that is about the size of a nokia 8210 so it's not like you have to carry a huge brick either. I guess the battery is pretty dead now though. But it is replaceable like all batteries of that time.


I never considered DECT phones as anything more than cordless landline phones for your home that can intercom between each other. Even the cordless phone systems in the US you can buy are usually 2.4GHz ISM now.

US DECT is 2.4 GHz, EU DECT has dedicated spectrum. Also, roaming works butter smooth. It's what's used often to provide cordless phone coverage to hospitals, for example.

DECT is still extremely popular within (private) houses in Germany.

Way more robust than VoIP over Wifi.


I think it's a CCC tradition.

Yes, although you can also use GSM or SIP and it's often called a DECT number even if you're actually on one of the newer networks, since the number space is the same. DECT simply was there first and thus became the generic term for the internal phone network.

There is a conference phone network hosted by eventphone. The most popular way to access it is indeed using DECT handsets, but you can also access it via SIP (probably the second most popular method), GSM (yes, really, they used to hand out SIM cards), landline (supports rotary phones!) and probably even more esoteric ways. There's also a post office delivering mail both internally and externally.

Don‘t they even have an ISDN network there this year?

Yes, I was looking at the conference website before it started and they still operate DECT phones.

I'm wondering how deep the hack is... it seems sending a frame is just setting some registers and waiting for an interrupt. This suggests (though I'm not an expert!) that they are talking to another layer of firmware that does the actual stuff? Reminds me a bit of the Raspberry pico board which has the main RP2040 SoC but where the WiFi is a separate WiFi/BT module (CYW43xx) with its own Arm cores. Not even the external register interface to the WiFi module is documented publicly, but there is an open source driver (https://github.com/georgerobotics/cyw43-driver/tree/cf924bb0...) so one can infer the specification. However, this driver yet again talks to software running on Arm codes inside the module, the code for which is supplied as big firmware binary blobs by the manufacturer (the blobs are actually in the linked repo, defined inside header files in the firmware directory). I'm wondering how this ESP32 hack corresponds to this?

I am really impressed by how young speakers are. It is really fascinating to see how somebody collect such technical knowledge at such a young age.

Everything is out in the open nowadays. Kids can start learning whatever they what an younger and younger ages.

A perfect example is chess. It used that a lot of knowledge was in books, often in foreign languages. Nowadays everything is out there in the open and additionally you can casually play games against top 100 opposition once you are okeish enough accelerating the development even more.


Dude on the left looks like my doppleganger...... I had to think back to remember what I'd being doing recently - nope, no holes in my memory!

Haha how cool, are you on the 38c3 too?

One step closer to a microPython library that supports promiscuous mode...

Why? That's already supported in the ESP SDK

Then it could be exposed to MicroPython, presumably relatively easily...

Because some people can't deal with C style syntax, I guess? I can't blame them though, you would have to hold a gun to my head to get me to code in Python.

I understand but why would an open Mac help with a Python interface?

Doesn't matter if the C code is open or not when calling into it from Python



Yeah I remember with the 8266 we could do all sorts of cool stuff but Expressif took it upon themselves to block a whole range of operations with the ESP32 :'(

I guess that they had no choice, the 8266 was originally meant to only be used in serial to WiFi converters but it kinda exploded in the maker community. I guess that drew regulator attention.

But cool to see that this is being worked around.


could you elaborate? what can be done with the "old" ESP8266 that can't be done with ESP32?

Why are wifi ICs so expensive? It seems to me that it is cheaper to buy an ESP32 to connect to a RP2040 for wifi than it is to buy a dedicated wifi IC.

The wifi protocol is computationally intensive. The wifi module is effectively a fast 32-bit computer with fairly complex firmware. And then, there's all the RF engineering that needs to happen to make it work.

So, the original thinking was "if you need wifi, we can't price a standalone chip competitively, just buy a SoC". But the genius of ESP32 was that they approached it the other way round: they built a wifi chip, and then figured they can carve out some room for user code. No need to pay for a separate MCU. This worked for a lot of customers, and the economies of scale took care of the rest.


Wi-Fi chips always had "user" program area, in theory anyone could call any of chip vendor, and with NDA, $$$ an 5 years of back and forth, could have met the exact same goal as what you can do today with ESP32, even in 2010. I've seen a Twitter ticker display made from a mPCI Wi-Fi card in a maker meeting back then. The guy demoing it was a company engineer with access to internal docs, wasn't giving it to anyone else.

The genius of Espressif was that they didn't issue C&D letters and DMCA takedowns when people started modifying firmware for their product using garden variety GCC without even asking and then ported hobbyist garbage called Arduino Core. They did initially panic a bit, but soon their management realized it's a golden ticket to something, and they bet the whole company on it. And they got the return they deserve.

There aren't a lot of aspects that are technically so advanced about ESP8266/ESP32. It's just the ones made by the hungriest and most aspiring Wi-Fi chip manufacturer.


Is there a write up somewhere talking about the panicking? It might be interesting to read. I am curious how they enabled people to do this without realizing people would do it.

I wasn't in the scene directly but was only watching it from great distance. It was literally a decade ago, too. Maybe someone can ask Espressif for their side of battle story, but I don't have any more to offer, sorry.

To chime in, adding the espressif WiFi libraries to your firmware adds 500-600KB of code. In the trivial IoT widget I just made, the firmware is >90% espressif code by weight.

The RAM use is also... noticeable. It takes quite a lot for this chip do WiFi.


It is similar for BLE. I recently wrote firmware for nrf52 device. Proprietary blob was 100 KB. My code was 60 KB and actually like 40-50 KB was caused by crypto library which is basically required part of BLE stack as well, just distributed with code and not in the blob.

ESP32 has 18 ADC input channels. But if you are using Wifi, you can only use 8 of the 18 for ADC conversion: GPIO pins 32-39.

Other 10 pins, on which ADC2 channels are possible, can only accept pulse data if you are using Wifi.

This is probably due to firmware limitations.


Espressif implies that the WiFi hardware uses ADC2 for something. It sounds like a hardware limitation, a firmware issue would have been patched a long time ago.

It sounds like Qualcomm missed an opportunity here:

https://github.com/qca/open-ath9k-htc-firmware


How is progress toward a useable open source alternative?

Virtually non-existent? There aren't that many people doing open RF hardware, and all of the ones I'm familiar with are working with SDR because the costs go up massively once you go to tapeout.

I am not sure if you can still get the chips, but these are fully OSS:

https://github.com/qca/open-ath9k-htc-firmware


Why doesnt Apple use ESP32

Because the ESP can only barely do WiFi. You can get a couple of Mbps under ideal conditions. It is not a general purpose WiFi adapter, it's a low power IoT chip.

A general purpose WiFi adapter can do gigabit sustained connections over PCI or some other high speed interface. Entirely different class of chip.


A couple?

It easily goes to tens of Mb/s.


Which is still abysmal compared to what a modern Wi-Fi chipset can push, even in the real world. Even an old home-grade Wi-Fi 5 AP can push >400Mbps over the air in real-world conditions. And the Wi-Fi 6/6e/7 devices can go well above that.

Anecdote only: I've never consistently managed 10mb/s without integrating some sort of cooling system. Not without frying the chip.

Citation needed.

While they’re only now coming out with even a 5GHz model there isn’t really much in Apple’s product line that needs a lowend primarily “IoT” WiFi. Maybe the HomePod, but they already have better chipsets for their flagship devices.

To what end?

I can't think of an Apple product that needs low power Wifi and/or Bluetooth, and also operates at such a low price-point that there's not budget to put something bigger on the BoM.


* Too slow * Uses too much power

Apple products would absolutely suck if they used ESP32 for their wifi and Bluetooth functionality.


The ESP8266 (the predecessor to the ESP32) was initially sold as a wifi IC, using an AT protocol over UART to communicate with the host MCU. Then some people discovered how to use it directly as an MCU, and the documentation and SDK slowly started being made available.

As for why? Regulatory (FCC) compliance is probably a part of it, I think the ealy ESP chips were dubious in this regard. Licensing might be a factor as well (a lot of wifi chips use ARM cores; Espressif doesn't, though not sure how much of a factor this is). Support comes into it too - established wifi vendors provide support and help you with RF designs; Espressif has forums (maybe larger customers get proper support now?)


I also share the opinion of the fellow commentor and blame the price on the fact that RF front-ends require lots of RnD, often require high quality and precision components (outside the IC) AND on top of that there are testing and certification costs. All of this in just the RF front-end, we are not even talking about the implementation of the absurdly bloated wifi standars in software/silicon and testing and certification for them.

The Espressif chips are WiFi ICs. You can buy the bare chips, connect over SDIO, load the hosted firmware, and use them as WiFi radio chips.

For volume production (10K, 100K, or more units) you can get other WiFi ICs that are cheaper than buying an ESP32 module. The difference is that other companies don’t care about engaging the hobby and low volume markets so they don’t put an effort into making them cheap.

If you’re doing one-off builds, you’re at the mercy of whoever decides to make an effort to make things cheap and accessible. Some companies deliberately make their products hard or even impossible to access for hobbyists because it’s not worth it unless you’re the hobbyist market leader (Espressif)


Do you mean this firmware?

https://github.com/espressif/esp-hosted

I assume it uses the blob that is mentioned in the video.


The WiFi (& Bluetooth) IC used in the Pi Pico W retails for ~$2.5, and presumably a bit less in volume (considering the Pico W is only $2 more than the base Pi Pico.

Esp32-c3 super mini is less than $2 with free shipping from AliExpress. The usb-c cable I use to power it is more expensive. I get a serious cognitive dissonance when I think about it too much.

you can get certain variants of the esp32 at around 2USD. that gets you a whole board with USB-c.

Where can you find it for $2.5? The last I looked, it was around $6.

They are talking about the radio chip that's on the Pico W. not the whole pico w.

I am asking about the radio chip. The last I checked, buying one from a distributor costs around $6. You would need to do a huge order to get the price down to $2.5 per chip. The required order quantity is so huge that distributors do not list it.

From https://octopart.com/search?q=CYW43439&currency=USD&specs=0.

Indeed the lowest price $2.551 from Arrow has a MOQ of 5000 but Newark does have it for a promotional price of $2.73 for quantities as low as 1.

It’s not $2.5 but that’s why it was quoted as ~$2.5 in my reply, since it’s in the ballpark.


Thanks. I had not known about octopart.

Only the ones which have a presence outside of China are expensive.

Why is that? Cost of labor? Looser regulatory requirements?

He’s telling you that they violate IP law extensively in products that don’t leave the country. It’s a lot cheaper to mass produce cheap WiFi chips when you can do it with stolen IP.

IP is defined by RFCs, not law.

(damn, the imaginary property maximalists really came out of the woodwork on this thread)


They have a very different view of IP than the west. Sharing is the norm.

Which is super weird, because Xioami isn’t “sharing” their proprietary OS with any other phone manufacturers.

CATL isn’t “sharing” any of their battery IP with competitors. They consider it trade secret and will actively pursue recourse inside or out of China.

What is apparent is they use cultural misunderstanding to justify stealing IP, even though they actively try to protect their own inside and outside of the country.

https://www.ess-news.com/2024/10/28/calb-sues-catl-over-pate...


It's normal. IIRC Early America didn't have Copyright or other protections, they were added later once it was making its own works and had skin in the game.

What about it is normal? "Early America" allowed copyright infringement on American soil as long as the IP was stolen from foreign nations, but simultaneously enforced IP nationally and internationally on any claims made by a US company?

Do you have some examples of this? Because I hear it parroted a lot and yet the only thing people can point to is "but the US stole some designs from Brittain on some early machines" - which is not at all what we're talking about here, and was at nowhere near the scale of China's theft.


You probably heard references to Samuel Slater. He memorized the plans for British textile equipment and brought them to the US. He violated British law, but US law did not mind.

Then there is Eli Whitney, to give an example of an American who enjoyed US patent protection. He patented his cotton gin.

You would want to ask a historian for other examples.


Copyright and patents have been a part of the US since before day one. It's in Article 1, Section 8 of the Constitution and was even part of the Articles of Confederation.

Patents were established even before Columbus.


So now that China has skin in the game, will they very soon stop stealing IP by your logic?

"sharing is the norm" means publishing.

Taking is the norm.


Does that work for other things? Can I just say “I had a different view of that” and get away with whatever it was?

For many people, information and physical items are completely different entities. When you steal bottle of milk, the original owner loses access to it. When you copy information without permission, the original owner keeps the access to it. So they have completely different attitude to those two behaviours.

> For many people, information and physical items are completely different entities. When you steal bottle of milk, the original owner loses access to it. When you copy information without permission, the original owner keeps the access to it.

Relevant:

Copying Is Not Theft

https://www.youtube.com/watch?v=IeTybKL1pM4

  Copying is not theft.
  Stealing a thing leaves one less left
  Copying it makes one thing more;
  that’s what copying’s for.
  
  Copying is not theft.
  If I copy yours you have it too
  One for me and one for you
  That’s what copies can do
  
  If I steal your bicycle
  you have to take the bus,
  but if I just copy it
  there’s one for each of us!
  
  Making more of a thing,
  that is what we call “copying”
  Sharing ideas with everyone
  That’s why copying
  is
  FUN!


I don't think they actually do. They're not dumb or crazy. What I think sets Chinese companies apart from Western counterparts is their aptitude for making money through selling physical things. Everyone else drove off to casinos and they're the last ones in the factory dirtying hands.

As someone growing up in Soviet Union, sharing was the norm for us as well until we were in this s**t together and nobody had any chance to earn much from it anyway. This changed quite fast in nineties though.

So what I can walk into any store and walk out with a cart full and not pay and it's all good, sharing is the norm? I can just walk into any apartment complex and move into any unit without pay since sharing is the norm?

Well, those things aren't IP. Maybe you could take pictures of all the pages in a book in a bookstore?

So only intellectual property is shared? Doesn't sound to me like sharing is the norm when it only applies to one category of goods.

Try reading my comment fully again? I was talking about IP.

No, that's not what anyone said. The conversation is about copyright...

So it's not that "sharing is the norm" it's a difference in the understanding of ownership and property rights. Otherwise why not share the food and share the housing, since sharing is the norm and not the exception when it comes to property rights?

Otherwise why is sharing the norm in one small specific instance and not the rest?


The original statement was in the context of IP. In this case, no one has anything taken away when it is shared. Sharing physical goods requires them to be taken from somewhere/someone... not so much for digital information, which can be duplicated infinitely.

This is a funny comment in the context of a discussion about a (nominally) communist country.

Now with the impeding tariffs do we have any viable microcontroller alternatives for us hobbyists ? Aka cheap, feature rich and well documented?

If the tariffs are 100% then a C3 is still like $6.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: