PlatformIO

Post Reply
mr-roboto
Posts: 16
Joined: Sat Jul 28, 2018 4:11 am
languages_spoken: english
ODROIDs: ODROID GO
Has thanked: 0
Been thanked: 0
Contact:

PlatformIO

Unread post by mr-roboto » Sun Aug 26, 2018 8:51 am

I am trying to use PlatformIO to go through the Arduino coding camp, but it does not appear to be finding the ODroid libraries. Here is what I have done...

1. Install VSCode
2. In VSCode, install the PlatformIO extension
3. Once PlatformIO is installed, I select New Project
4. I search for a board - ODROID-GO, which it finds as part of the espressif32 package. I also select the Arduino framework for the project, instead of the ESP-IDF.
5. I title the new project as something like odroid-test1 and it goes off and spends a bunch of time downloading things.
6. It comes back with an empty Arduino project that appears to compile without error.
7. When I go to add the odroid_go header file, the code complete does not work. If I paste the Hello world example in there, it complains that it cannot find the odroid_go.h file.

It looks like the library is not installed. If this is the case, why can I create a new project and select this specific board?

Are there any PlatformIO pros out there that can tell me what is going on?

Thanks,

lsc1117
Posts: 116
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by lsc1117 » Mon Aug 27, 2018 3:44 pm

The PlatformIO is probably not available in the current ODROID-GO folder structure.
In PlatformIO, a source file should be in the src folder. In Arduino, a source file should be in a directory of the same name.
Also, it is not easy to satisfy both platforms because of the library folder.

I will try the pio in the ODROID-GO project.

Hossie
Posts: 26
Joined: Tue Feb 28, 2017 1:10 am
languages_spoken: english, german
ODROIDs: XU4, H2, Go
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by Hossie » Tue Aug 28, 2018 1:27 am

Did you try installing the Odroid Library?

Code: Select all

~ $ pio lib search odroid
Found 1 libraries:

name=ODROID-GO
==============
#ID: 5688
sentence=A library for ODROID-GO development kit

Keywords: esp32, odroid
Compatible frameworks: Arduino
Compatible platforms: Espressif 32
Authors: Seungchul Lee

mr-roboto
Posts: 16
Joined: Sat Jul 28, 2018 4:11 am
languages_spoken: english
ODROIDs: ODROID GO
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by mr-roboto » Thu Aug 30, 2018 7:31 am

I thought that would have been done when I selected the ODroid-GO platform.

So I went to the PIO Home Page, Libraries and searched for the ODroid-GO library, and clicked on the little download icon. This brought me to the page that had the "Install" button.

Now it is failing for not finding a WiFiServer.h file. A search on that yields multiple libraries. Still trying to find one that works.

mr-roboto
Posts: 16
Joined: Sat Jul 28, 2018 4:11 am
languages_spoken: english
ODROIDs: ODROID GO
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by mr-roboto » Fri Aug 31, 2018 7:11 pm

On the Arduino, WiFi.h appears to be in the ESP8266 library. So I went to PIO Home Page, Libraries, searched for ESP8266, and found the ESP8266-driver library, and pressed the Install button. When I built my empty project, it still could not find WiFi.h.

Still searching.

mr-roboto
Posts: 16
Joined: Sat Jul 28, 2018 4:11 am
languages_spoken: english
ODROIDs: ODROID GO
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by mr-roboto » Fri Aug 31, 2018 7:41 pm

I also tried installing the WiFi library from Arduino. Still no luck.

It appears to be failing in compiling the library. Do I have to do something to connect the ODROID library with the Arduino library?

/Users/brose/.platformio/lib/name_ODROID-GO_ID5688/src/web/Parsing.cpp:23:24: fatal error: WiFiServer.h: No such file or directory

Hossie
Posts: 26
Joined: Tue Feb 28, 2017 1:10 am
languages_spoken: english, german
ODROIDs: XU4, H2, Go
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by Hossie » Sat Sep 01, 2018 12:33 am

Platformio only adds libraries which are compatible with the board.

The Esp32 normally does not need special libraries for Wifi (the esp8266 does). So just and only include WiFi.h, which should be enough.

mr-roboto
Posts: 16
Joined: Sat Jul 28, 2018 4:11 am
languages_spoken: english
ODROIDs: ODROID GO
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by mr-roboto » Sun Sep 02, 2018 10:32 am

WebSockets.cpp is including WebSockets.h
WebSockets.h has this...

Code: Select all

#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
This implies that the ESP32 library should have a WiFi.h. After installing several other libraries in an attempt to get this working, there are now three other WiFi.h files in these other library folders. When platformIO is building the ODROID library, it must not have these other library include paths in its build path.

Furthermore, I was reading in a file somewhere that the libraries are built as static objects which are then linked to your application code. This tells me that each library is built independently. Otherwise we'd be getting complaints from the compiler about multiple definitions for WiFi.h.

This seems to me to be an ODroid Library problem. I don't know enough about the PlatformIO build system and how it differs from the Arduino build system to fix it properly.

moerchel
Posts: 1
Joined: Thu Apr 25, 2019 12:15 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by moerchel » Thu Apr 25, 2019 12:18 am

Same problem here.
Is there any solution or hint on how to compile for Odroid-Go on PlatformIO?

lsc1117
Posts: 116
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Re: PlatformIO

Unread post by lsc1117 » Mon Apr 29, 2019 12:28 pm

If you don't use RTC or Weather_Station applications in the examples, you can remove the web folder in src.
Then it won't occur errors.
The web folder exists just for those two applications.

Post Reply

Return to “Arduino Coding Camp”

Who is online

Users browsing this forum: No registered users and 1 guest