Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

how to run one of the examples? #2

Closed
jcw opened this issue Oct 26, 2020 · 9 comments
Closed

how to run one of the examples? #2

jcw opened this issue Oct 26, 2020 · 9 comments
Labels
Support Library support

Comments

@jcw
Copy link

jcw commented Oct 26, 2020

Hello - I'm trying out your project with PlatformIO and a Nucleo-F767ZI. I've adjusted the settings in platformio.ini for PIO v5, but can't seem to figure out how to run any of the examples. The dependencies are fetched and compile properly, but then the link fails due to missing setup/loop functions.

What's the proper way to compile one of the hello examples? It tried copying the platformio.ini file one level up, and copying it into an example folder, but that doesn't work.

Cheers -jcw

@khoih-prog
Copy link
Owner

khoih-prog commented Oct 26, 2020

@jcw

Thanks for your interest in the library.
It's difficult to know what's wrong in your PlatformIO installation and/or settings/usage. I really don't have much experience in solving that to help you out now.

I suggest you to post the question on PlatformIO Forum to ask for support from experienced people specialized in PIO.

Hopefully you'll post your experience on how to fix the issue here to help other library's users.

Regards,

@khoih-prog khoih-prog added the Support Library support label Oct 26, 2020
@jcw
Copy link
Author

jcw commented Oct 26, 2020

Ehm ... there's nothing wrong with my PIO setup. I've been using it for years. I was merely asking how to try out your sample code. I don't think people in the PlatformIO community can help figure out how you've intended your examples to the used. But hey, thanks anyway. All the best -jcw.

@jcw
Copy link
Author

jcw commented Oct 26, 2020

Looks like the problem is here:

In file included from src/Async_HelloServer.cpp:88:
.pio/libdeps/STM32/AsyncWebServer_STM32/src/AsyncWebServer_STM32.h:27:10: fatal error: STM32AsyncTCP.h: No such file or directory

***********************************************************************
* Looking for STM32AsyncTCP.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:STM32AsyncTCP.h"
* Web  > https://platformio.org/lib/search?query=header:STM32AsyncTCP.h
*
***********************************************************************

   27 | #include <STM32AsyncTCP.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

Adding philbowles/STM32AsyncTCP as dependency does not help, due to this line:
https://github.com/philbowles/STM32AsyncTCP/blob/master/library.json#L18

Also here: https://github.com/khoih-prog/STM32AsyncTCP/blob/master/library.json#L18

@khoih-prog
Copy link
Owner

So the Phil Bowles' STM32AsyncTCP very-new library has not been included into PIO Library Manager.

You can copy/install it manually or post an issue on STM32AsyncTCP to ask the Author to fix the issue as we can't do that.

There is one issue posted there relating to your issue:

library.json has wrong platform

@jcw
Copy link
Author

jcw commented Oct 26, 2020

Aha, yep. I'll try this. BTW, since you have a fork, you could also fix it there - for the time being anyway ...

@khoih-prog
Copy link
Owner

Aha, yep. I'll try this. BTW, since you have a fork, you could also fix it there - for the time being anyway ...

I'm a litlte bit hesitant to do so as this is his right to his library to make it included into PIO Library Manager.

In the mean time, just download a copy of STM32AsyncTCP Library, then copy the whole library directory onto ~/.platformio/lib for Ubuntu/Linux machine.

@jcw
Copy link
Author

jcw commented Oct 26, 2020

That's what I did. I had to make one more change, see philbowles/STM32AsyncTCP#1 - now your hello example builds and works properly \o/

There's no need to wait for him to make the change, you can simply adjust your own platformio.ini to this:

lib_deps =
  khoih-prog/STM32AsyncTCP
  AsyncWebServer_STM32

PIO will then go directly to your fork to fetch the library (because the library is named "abc/def", i.e. with a slash). Use of the PIO library registry is optional. You're not interfering with Phil's right, as author, to be listed in PIO's registry.

The other dependencies can be dropped, PIO will find them.

So to summarise: if you adjust your fork and platformio.ini file, then to run one of your examples, copy that ini file to a new folder, create a subdir named "src" with the example .ino in it, and that's it, pio run will do the rest.

PS. No need to copy the library to a global area. Here's my test setup, which compiles and runs properly:

$ tree
.
├── lib
│   └── STM32AsyncTCP
│       ├── LICENSE.txt
│       ├── README.md
│       ├── library.json
│       ├── library.properties
│       ├── src
│       │   ├── AsyncPrinter.cpp
│       │   ├── AsyncPrinter.h
│       │   ├── DebugPrintMacros.h
│       │   ├── STM32AsyncTCP.cpp
│       │   ├── STM32AsyncTCP.h
│       │   ├── STM32AsyncTCPbuffer.cpp
│       │   ├── STM32AsyncTCPbuffer.h
│       │   ├── SyncClient.cpp
│       │   ├── SyncClient.h
│       │   ├── async_config.h
│       │   ├── c_types.h
│       │   ├── cbuf.cpp
│       │   ├── cbuf.h
│       │   ├── debug.cpp
│       │   ├── debug.h
│       │   ├── tcp_axtls.c
│       │   └── tcp_axtls.h
│       └── stm32asynctcp.code-workspace
├── platformio.ini
└── src
    └── Async_HelloServer.cpp

@jcw
Copy link
Author

jcw commented Oct 26, 2020

One more note: I had to add this setting as well:

build_flags = -DSTM32F7

And fix the #if !( defined(STM32F0) || defined(STM32F1) || etc... in the example, which was missing STM32F7.

khoih-prog added a commit that referenced this issue Oct 26, 2020
See [how to run one of the examples?](#2)
khoih-prog added a commit that referenced this issue Mar 22, 2021
### Releases v1.2.6

1. Fix dependency on unpublished [**STM32AsyncTCP Library**](https://github.com/philbowles/STM32AsyncTCP). Check [Compilation broken due to error in STM32AsyncTCP dependency](#4) and [how to run one of the examples?](#2).
khoih-prog added a commit that referenced this issue Mar 22, 2021
### Releases v1.2.6

1. Fix dependency on unpublished [**STM32AsyncTCP Library**](https://github.com/philbowles/STM32AsyncTCP). Check [Compilation broken due to error in STM32AsyncTCP dependency](#4) and [how to run one of the examples?](#2).
@khoih-prog
Copy link
Owner

Hi @jcw

Thanks for your contribution. As the issue is spanning across several libraries, I have to take over to modify and release the new version.

Your and chris007de contributions have been noted in Contributions and Thanks

Please check to see if there still any other issue.


Releases v1.2.6

  1. Fix dependency on unpublished STM32AsyncTCP Library. Check Compilation broken due to error in STM32AsyncTCP dependency and how to run one of the examples?.

khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Generic that referenced this issue Mar 23, 2021
### Releases v1.1.5

1. Fix dependency on unpublished [**STM32AsyncTCP Library**](https://github.com/philbowles/STM32AsyncTCP). Check [Compilation broken due to error in STM32AsyncTCP dependency](khoih-prog/AsyncWebServer_STM32#4) and [how to run one of the examples?](khoih-prog/AsyncWebServer_STM32#2).
khoih-prog added a commit that referenced this issue Mar 23, 2021
### Releases v1.2.6

1. Fix dependency on unpublished [**STM32AsyncTCP Library**](https://github.com/philbowles/STM32AsyncTCP). Check [Compilation broken due to error in STM32AsyncTCP dependency](#4) and [how to run one of the examples?](#2).
khoih-prog added a commit to khoih-prog/AsyncHTTPRequest_Generic that referenced this issue Mar 23, 2021
### Releases v1.1.5

1. Fix dependency on unpublished [**STM32AsyncTCP Library**](https://github.com/philbowles/STM32AsyncTCP). Check [Compilation broken due to error in STM32AsyncTCP dependency](khoih-prog/AsyncWebServer_STM32#4) and [how to run one of the examples?](khoih-prog/AsyncWebServer_STM32#2).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Library support
Projects
None yet
Development

No branches or pull requests

2 participants