基于RPi和LXD的ESP32开发环境
对于在板子手动重启时经常把ESP32带进下载模式的问题,LAN8720所需的上/下拉电阻恐怕是最大嫌犯。于是斥巨资近CNY 10元采购了万用板、线仔包和各种直/弯母座,终于搞了MKII —— 重启可靠性问题果然迎刃而解。
过程中,基于lxd的Debian in Debian做了套新环境,顺手也试了试C语言的esp-idf编译,用起来整体感觉很顺手。
Yes, it actually performs nicely to work on ESP32 development in debian bullseye LXD in Pi OS, no mater you’re working on hardcore C lang based esp-idf or the nice & easy micropython development.
“Hmm… so you need a standard Debian in a derived Debian? “
Well, since I found out that LXD is something very helpful to isolate different needs on different Linux distributions in different containers, while it kinda works pretty much like vm (instead of docker) since it’s easy to config the resources consumption or even usb devices pass-through, and the most important – having its own block storage which can be exported into a single archive.
Then, the only thing I can’t agree with, could be the deep connection with the snapd. Instead of switching to another distribution, such as Arch, I choose to build the LXD of my own (on both Pi OS aarch64 and Ubuntu 22.04 X86_64). Thanks to the good documentation, the stuff (native lxd without the snap crxp) works like a charm.
Don’t worry if you’re a tough guy who’s working on esp-idf and RTOS stuff, another post already got you covered. The only difference here is what should be done are accomplished in the lxc.
“But how about the physical serial connection to the esp32 hardware?”
Well, good to know your needs again, now we can pass the unix-char device directly from Pi OS to the lxc without any tiny issue.
Cool to allow the lxc to consume all processor cores on esp32 code cross-compiling, while those packages installed for development are not in the host OS and can be easily removed by lxc stop <ct_name> and lxc delete <ct_name> with nothing left.
Anyway, my simple indoor weather station (MKII) now works well. It’s way much better than the MKI on bread board, special thanks to one more blog post that helps pretty much to me – just like others who where stuck by either the clock source or esp32 download mode issue.
文章的脚注信息由WordPress的wp-posturl插件自动生成