micro-ROS / micro-ROS/micro-ROS-Agent

instruction for solving issue with this error : " AttributeError: module 'em' has no attribute 'BUFFERED_OPT' when building firmware for esp32 on udp transfering

未关闭
#232 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
201
派生
111
平均合并
1 天 6 小时
30 天内合并 PR
10

描述

## Issue template

- Hardware description: esp32
- RTOS: freeRtos
- Installation type: micro_ros_setup
- Version or commit hash: version of micro-ROS used: galactic for Ubuntu 20.04

#### Steps to reproduce the issue
Assuming you have already setup the firmware using `ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32` and after proper wifi configuration, when you try to build the firmware for udp transferring using `ros2 run micro_ros_setup build_firmware.sh` you will most likely get an error which related to the Python environment and the em (Empy) module. The specific error is:
```
AttributeError: module 'em' has no attribute 'BUFFERED_OPT'
```

#### To resolve this issue, follow these steps:

1. First, deactivate any active Python virtual environments:

```
deactivate
```

To install empy in the specific Python environment used by the build process, you should use the pip associated with that Python installation. Here's the command to install empy version 3.3.4 in that environment:
```
~/microros_ws/firmware/toolchain/espressif/python_env/idf4.1_py3.8_env/bin/pip3 install empy==3.3.4
```
2. After that, verify the installation:
```
~/microros_ws/firmware/toolchain/espressif/python_env/idf4.1_py3.8_env/bin/python3 -c "import em; print(em.__file__)"
```

3. Update setuptools and wheel:
```
~/microros_ws/firmware/toolchain/espressif/python_env/idf4.1_py3.8_env/bin/pip3 install --upgrade setuptools wheel
```

5. Clean your micro-ROS workspace:

```bash
cd ~/microros_ws
rm -rf build install log
```

6. Rebuild the workspace:

```bash
colcon build --symlink-install
```

7. Source the setup file:

```bash
source install/local_setup.bash
```

8. Try building the firmware again:

```bash
ros2 run micro_ros_setup build_firmware.sh
```

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从报告的 `ros2 run micro_ros_setup build_firmware.sh` 失败以及位于 `firmware/toolchain/espressif/python_env/idf4.1_py3.8_env` 的 ESP32 Python 环境开始。验证 `em.BUFFERED_OPT` 错误和列出的 Empy 安装步骤,然后确定应在哪里记录此变通方法;完成的标准是固件构建说明清楚涵盖该错误及恢复方法。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
build-system, embedded-iot
Issue 类型
文档
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。