esp32-cam+micropythonlt Too hard to play

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
qiu_lzsnmb
Posts: 1
Joined: Wed Jan 05, 2022 1:46 pm

esp32-cam+micropythonlt Too hard to play

Post by qiu_lzsnmb » Wed Jan 05, 2022 1:50 pm

I bought 2 esp32-cams on Taobao Anxinke official website a few days ago to play
Plan to get a monitor in the corridor of the bedroom. . . . , And then connect the socket to the mobile phone and cooperate with the 180° steering gear to monitor whether there are teachers on both sides of the corridor*.*
Then I flashed the micropython firmware, Arduino can't use it, only js, python, java. . . . .
It went well at the beginning. I got the udp protocol to test it. It can make the rudder maneuver and the flashing light. It feels quite simple.
Then I got the camera today for a day. , Really outrageous.
I used multi-threaded socket, so it won’t be blocked, and then the camera can’t be initialized, but the main.py file of another big guy under station b can run. I slowly commented and tried it out. It seems to be multi-threaded. The camera cannot be initialized. .
Cut off the multithreading, and then changed tcp to receive data and save pictures. . At the beginning, I don’t know why esp32 only sends 1440 and 4320 bytes of data, but it is always incomplete. The pictures are half of them. I thought it was a problem with my own reception, so I wrote a lot of things and used struct to convert the picture size to 4 words. Section, send first, then receive, then transfer back to the original data, and then receive. . . Then there is still the same problem. . .
I'm doing it, I don't know how he took a picture of 59531529 bytes, 60MB. . . Then only 73853 was received, and then it was automatically repaired? ? Outrageous

Then I tried a few times without any problems, I went to slowly restore the previously annotated, and found that the steering gear and flash were controlled, and after that, the camera could not be initialized. tm.
Every time it's completely different from what I thought, it's really difficult to do, so I ask the great gods for help. . . .

(Lanzou format is restricted, changed to txt, cam is a self-written module, and can’t be used. It’s difficult.)
https://wwi.lanzoup.com/b0d3shwnc Password: 6ply


-------------
前几天在淘宝安信可官网买了2个esp32-cam来玩
打算弄个监控放寝室走廊。。。。,然后socket和手机连接,配合180°舵机,就能监测走廊两侧有没有老师*.*
然后刷了micropython的固件,Arduino用不来,只会js,python,java。。。。。
一开始还顺利,弄的udp协议,来测试,可以让舵机动起来,闪光灯闪起来,还感觉挺简单
然后今天弄摄像头,弄了一天。,真的离谱。
socket我用了多线程,这样不会堵塞住,然后摄像头死活不能初始化,但b站下的另一个大佬的main.py文件却可以运行,我慢慢是注释,试出来,好像多线程里面不能初始化相机。。
就把多线程砍了,然后换了tcp来接收数据,保存图片。。一开始,不知道为什么esp32那只会发送1440和4320字节的数据,就一直不全,图片都是一半,还以为是自己接收的问题,就写了杂七杂八,用struct把图片大小转成4字节,先发送,然后接收转回原数据,在接收。。。然后还是一样有毛病。。。
搞着搞着,不知道他怎么拍了59531529字节的图片,60MB啊。。。然后只接收了73853,之后就自动修复好了??离谱

然后试了几次没问题,就去把之前注释的慢慢还原了,发现,控制了舵机和闪光灯,之后,摄像头又不能初始化了。tm的。
每次和想的都完全不一样,真难搞,求大神帮忙看看。。。。

(蓝奏格式限制,改成了txt,cam是自己写的模块,也不能用。难搞哦。)
https://wwi.lanzoup.com/b0d3shwnc 密码:6ply

Image
Image

Post Reply