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

Aberta
#232 1 comentário 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
C++
Estrelas
201
Forks
111
Merge médio
1d 6h
PRs com merge (30d)
10

Descrição

## 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
```

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece com a falha reportada de `ros2 run micro_ros_setup build_firmware.sh` e o ambiente Python do ESP32 em `firmware/toolchain/espressif/python_env/idf4.1_py3.8_env`. Verifique o erro `em.BUFFERED_OPT` e as etapas de instalação do Empy listadas e, em seguida, determine onde essa solução alternativa deve ser documentada; considera-se concluído quando as instruções de compilação do firmware abrangerem claramente o erro e a recuperação.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
build-system, embedded-iot
Tipo de issue
Documentação
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.