1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.55k stars 784 forks source link

Change/Support Building with PlatformIO #155

Closed scotthernandez closed 5 years ago

scotthernandez commented 6 years ago

I, and I'm sure many others , don't use the arduino IDE (regularly, or at all) so it would be good to have a command-line only build process. It would also allow people to completely script the build process for those that don't want to, or need easier instructions, to get started.

Also, I expect switching to platformio will enable more option for CI and other integrations, but I'm no expert there.

I understand switching completely (and then moving from ino->cpp files, I would hope) might be a burden on the main developers so just supporting building would be great as a start.

broekema commented 6 years ago

Alternatively a Makefile based build and install method could be an option. I've been playing with that for ESP8266, based on this work. Apart from some weirdness with code ordering (Arduino allows code to be used before it is declared, while C and C++ require forward declaration in such cases) it seems to be a viable alternative. If there is interest, I could prepare a pull request.

Code would most likely not have to change much for this to work.

scotthernandez commented 6 years ago

How open are we to switching away from using the arduino ide for building? I will work on the reorg needed for platformio and files needed if serious about using it from the main contributors.

1technophile commented 6 years ago

Is it possible to switch and let also the support for arduino ide = keep ino files

scotthernandez commented 6 years ago

Yes, I believe so, that would be my first suggested step. But I think the files at least need to move into src dir and deps will be managed by pio instead of linked into git. I'm not sure if that will allow arduino to build anymore since I'm not familiar with it.

On Jan 20, 2018 6:13 PM, "Florian" notifications@github.com wrote:

Is it possible to switch and let also the support for arduino ide = keep ino files

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/1technophile/OpenMQTTGateway/issues/155#issuecomment-359209704, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHAG2pdJ5ZSQ8fMitcs0Q-18xMjLKASks5tMnMhgaJpZM4RaHRy .

bukurat commented 6 years ago

A number of the libraries are already set up for PlatformIO. Look for a PlatformIO.ini file in the root directory. PlatformIO will compile .ino files so it is possible to build on either platform. PlatformIO doesn’t create function prototypes like the Arduino IDE so prototypes are needed. I have started setting up my fork of the program for PlatformIO. I have moved the source and headers into the source directory and told PlatformIO to use the library directory for the dependent libraries, rather than the default lib one.

scotthernandez commented 6 years ago

Great, I'll hold off on working on this unless you want help.

bukurat commented 6 years ago

The tasmota project builds with either PlatformIO or the Arduino IDE, although he does recommend separate Arduino IDE be set up for it.

My fork of this one is here Scott, if you want to help track down some compile errors.

thoscut commented 6 years ago

Have you managed to sucessfully build with pio?

cnf commented 5 years ago

I'm assuming no progress on this? I can't see any platformIO parts in the repo.

1technophile commented 5 years ago

Currently in progress in platformio-dev branch

cnf commented 5 years ago

ah, amazing! and just as platformIO went fully open, as well! <3 for the debugging! Thanks @1technophile !

1technophile commented 5 years ago

:-) integrated in development branch