randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/

 

Installing ESP32 in Arduino IDE (Windows, Mac OS X, Linux) | Random Nerd Tutorials

Learn how to install the ESP32 board add-on in Arduino IDE in less than 1 minute. This guides works in any operating system: Windows PC, Mac OS X, and Linux.

randomnerdtutorials.com

 

 

 

There’s an add-on for the Arduino IDE that allows you to program the ESP32 using the Arduino IDE and its programming language. In this tutorial we’ll show you how to install the ESP32 board in Arduino IDE whether you’re using Windows, Mac OS X or Linux.

Watch the Video Tutorial

This tutorial is available in video format (watch below) and in written format (continue reading this page). 

 

If you have any problems during the installation procedure, take a look at the ESP32 Troubleshooting Guide.

If you like the ESP32, enroll in our course: Learn ESP32 with Arduino IDE.

Prerequisites: Arduino IDE Installed

Before starting this installation procedure, make sure you have the latest version of the Arduino IDE installed in your computer. If you don’t, uninstall it and install it again. Otherwise, it may not work.

Having the latest Arduino IDE software installed from arduino.cc/en/Main/Software, continue with this tutorial.

Do you need an ESP32 board? You can buy it here.

Installing ESP32 Add-on in Arduino IDE

To install the ESP32 board in your Arduino IDE, follow these next instructions:

  1. In your Arduino IDE, go to File> Preferences
  2. Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” field as shown in the figure below. Then, click the “OK” button:

    https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
  3. Note: if you already have the ESP8266 boards URL, you can separate the URLs with a comma as follows:
  4.  
  5. Open the Boards Manager. Go to Tools > Board > Boards Manager…
  6. Search for ESP32 and press install button for the “ESP32 by Espressif Systems“:
  7. That’s it. It should be installed after a few seconds.

 

Testing the Installation

Plug the ESP32 board to your computer. With your Arduino IDE open, follow these steps:

1. Select your Board in Tools > Board menu (in my case it’s the DOIT ESP32 DEVKIT V1)

 

2. Select the Port (if you don’t see the COM Port in your Arduino IDE, you need to install the CP210x USB to UART Bridge VCP Drivers):

3. Open the following example under File > Examples > WiFi (ESP32) > WiFiScan

 

4. A new sketch opens in your Arduino IDE:

 

5. Press the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads to your board.

6. If everything went as expected, you should see a “Done uploading.” message.

7. Open the Arduino IDE Serial Monitor at a baud rate of 115200:

 

8. Press the ESP32 on-board Enable button and you should see the networks available near your ESP32:

Troubleshooting

If you try to upload a new sketch to your ESP32 and you get this error message “A fatal error occurred: Failed to connect to ESP32: Timed out… Connecting…“. It means that your ESP32 is not in flashing/uploading mode.

Having the right board name and COM por selected, follow these steps:

  • Hold-down the “BOOT” button in your ESP32 board

 

  • Press the “Upload” button in the Arduino IDE to upload your sketch:

  • After you see the  “Connecting….” message in your Arduino IDE, release the finger from the “BOOT” button:

  • After that, you should see the “Done uploading” message

That’s it. Your ESP32 should have the new sketch running. Press the “ENABLE” button to restart the ESP32 and run the new uploaded sketch.

You’ll also have to repeat that button sequence every time you want to upload a new sketch. But if you want to solve this issue once for all without the need to press the BOOT button, follow the suggestions in the next guide:

If you experience any problems or issues with your ESP32, take a look at our in-depth ESP32 Troubleshooting Guide.

Wrapping Up

This is a quick guide that illustrates how to prepare your Arduino IDE for the ESP32 on a Windows PC, Mac OS X, or Linux computer. If you encounter any issues during the installation procedure, take a look at the ESP32 troubleshooting guide.

Now, you can start building your own IoT projects with the ESP32!

 

Thanks for reading.

App threw an error during load
Error: The module '\\?\C:\Users\talon\OneDrive\Desktop\focus\node_modules\cap\build\Release\cap.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:155:31)
    at process.func [as dlopen] (electron/js2c/asar.js:155:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:155:31)
    at Object.func [as .node] (electron/js2c/asar.js:155:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (C:\Users\talon\OneDrive\Desktop\focus\node_modules\cap\lib\Cap.js:3:13)

 

 

 

Thank you this helped! Just for reference if anyone is having the same issues, here are the commands you need to run that come from the link provided by @mscdex:

npm install --save-dev electron-rebuild

 

 

 

was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module

I see, thanks for pointing that out!

I get it now: npm rebuild uses my local node (ABI 72), which isn't what electron has.

The question is, how can I get electron rebuild to work? I have the latest electron-rebuild, v 1.8.6.

This is what I've tried so far:

  • If I run npx electron-rebuild right now, then run Electron, I get the same 72 vs 73 error.
  • If I then remove node_modules and npm install, then the error becomes 48 vs 73.
  • If I then downgrade electron to ^5, re-install node_modules, error goes to 47 vs 70.
  • If I then run electron-rebuild, no change. 47 vs 70
  • If I then run npm rebuild, it goes to 72 vs 70 (seems to make sense, my node is v12, Electron v5 expects a lower ABI version).

Thanks for the help!

안녕하세요, 라즈베이 파이를 이용해 CM700을 제어하려는 학생입니다.

 

로보플러스를 이용해 지그비 리모콘 U를 누르면 다이나믹셀 목표위치를 0으로, D를 누르면 1024로, 떼면 512로 이동하는 간단한 테스크를 짜서 동작을 확인했습니다.

물론 현재 지그비 리모콘으로는 매우 잘 작동하며, 제 목표는 라즈베리파이의 GPIO 출력핀, 또는 LN101 USB를 통해 CM700과 UART 통신을 통해 리모콘을 모방하는 것입니다.

현재 간단하게 아두이노로 시리얼통신을 테스트중인데요, 통신 패킷이 잘 이해가 가지 않습니다.

지그비 SDK를 살펴본 결과,

int zgb_tx_data(int data)
{
    unsigned char SndPacket[6];
    unsigned short word = (unsigned short)data;
    unsigned char lowbyte = (unsigned char)(word & 0xff);
    unsigned char highbyte = (unsigned char)((word >> 8) & 0xff);

    SndPacket[0] = 0xff;
    SndPacket[1] = 0x55;
    SndPacket[2] = lowbyte;
    SndPacket[3] = ~lowbyte;
    SndPacket[4] = highbyte;
    SndPacket[5] = ~highbyte;

    if( zgb_hal_tx( SndPacket, 6 ) != 6 )
        return 0;

    return 1;
}

에서, 즉, int data로 입력받은 정수를 16진수화시켜 6바이트 통신 패킷에 맞게 변환시키는 것 까지는 이해했습니다. 

이때, unsigned char을 사용하는데, 즉, 통신패킷에 맞게 변환된 값은 char 형태로 저장되는 건가요?

통신 패킷으로 전달하는 데이터가 char인지, int인지, int면 보낼때 DEC로 보내야 하는지, HEX로 보내야 하는지 잘 모르겠습니다.

또 SndPAcket[6]이라는, 일종의 문자열인데 한번에 string으로 전달하는 것인지, 순차적으로 하나하나 전달하는 것인지 궁금합니다.

 

현재 아두이노 상에서 for문을 사용해 순차적으로 명령을 내리는 것을 테스트해 보았습니다. SDK에서 위 함수 전환 부분만 copy하여 포인터 관련 부분은 지워버리고, SndPacket을 전역변수로 바꾸어 테스트 했습니다. 

unsigned char SndPacket[6];

int zgb_tx_data(int data)
{
    //unsigned char SndPacket[6];
    unsigned short word = (unsigned short)data;
    unsigned char lowbyte = (unsigned char)(word & 0xff);
    unsigned char highbyte = (unsigned char)((word >> 8) & 0xff);

    SndPacket[0] = 0xff;
    SndPacket[1] = 0x55;
    SndPacket[2] = lowbyte;
    SndPacket[3] = ~lowbyte;
    SndPacket[4] = highbyte;
    SndPacket[5] = ~highbyte;

    //if( zgb_hal_tx( SndPacket, 6 ) != 6 )
        return 0;

    //return 1;
}

int t=0;

zgb_tx_data(t);
   
for(int m=1; m<=6; m++)
{
   Serial.print(SndPacket[m],HEX);// Serial.println("thtest");
 }

위 소스를 이용해 tx,rx를 크로스해 CM700에 입력해본 결과, 제어기의 RX LED가 깜빡이는건 확인했습니다만 모터는 작동하지 않더군요. 

 

CM700 제어기에 명령을 전달할때, 통신 패킷에 따라 어떻게 전달해야 하는지 궁금합니다.

결론적으로,

1. 명령의 자료형(int,char)은 무엇인지, 전달할때 DEC인지 HEX인지,

2. 위처럼 for문을 사용해서 6개의 데이터를 순차적으로 전달해야 하는지,

3. 아니면 SndPAcket[6]이라는, 일종의 문자열을 한번에 string으로 전달하는 것인지,아니면 또 다른 방법이 필요한지 알려주시면 감사드리겠습니다.

 

두서없이 질문드려 죄송합니다. 많은 조언 부탁드립니다.

 

에러에서 npm과 node가 latest_version 인지 확인하라는 메세지가 나온다.

환경단에서 gauge.isEnabled() 와 같이 등장할 수 있다.

 

1.

$ npm install latest-version

 

전체 환경인 상태에서 npm의 버전을 latest 로 올려준다.

또한, package-lock.json 이 found 되는 경우에도 라이브러리 설치에 여러모로 영향을 미치기 마련인데, 

 

package 관리자를 yarn 을 쓴다고 해서, yarn 으로 무조건 조져도 되는 것도 아니고... 

hang up 걸린 상태가 종종 등장하기 때문에, 

 

하드웨어 패키지 내부에서 npm install 대신에 yarn 을 설치해서 잡아줬어야 했고

전체 환경에서는 windows-build-tools 와 node-gyp 를 잡아줘야 했다.

 

어쨋든 @4.0.0 으로 설정하게 가버리면 완전 나가리가 된다.

+ Recent posts