Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Arduino code to platformIO based projects #136

Open
moritz89 opened this issue Dec 21, 2017 · 7 comments
Open

Move Arduino code to platformIO based projects #136

moritz89 opened this issue Dec 21, 2017 · 7 comments

Comments

@moritz89
Copy link
Contributor

The reason's I would be interested in moving to PlatformIO projects is:

  • Automated dependency management
  • Good continuous integration support

Other reasons include:

  • Code completion/syntax checking
  • C++ compiler instead of INO pre-compiler
    • Forces Object Oriented programming
  • Improved search functionality
  • Split-screen editor
  • Improved multi-platform support

I have already converted the hapifirmware source code to the PlatformIO format so that it can be tested. Installation instructions can be found in the folder itself.

@ozarchie
Copy link
Contributor

I have no problem with platform io. I use it for other projects and agree with your comments

@PedroSFreitas
Copy link
Contributor

@TylerReedMC I think we should add @ozarchie as member, so if needed we could tag his as reviewer.

@PedroSFreitas
Copy link
Contributor

@moritz89 I'm not familiar with PlatformIO, but nothing that I can get in a few days. Looks very good. And if @ozarchie approved I'm on board too.

@ozarchie
Copy link
Contributor

The arduino code was stable, and I can compare and test the revised PlatformIO on my system. Although I prefer more modular than monolithic block approach to the code, I will leave the PlatformIO code as you have coded.

The final issues really related to integration with the Python code.
While the nodes were able to send and respond to the MQTT data, the integration, control from and use of that data by the Python code was were the last issues lay. Once you are ready, I can help with that testing, if you wish. I have a multitude of sensors, ESP8266 as well as ESP32 based systems, and TI-bluetooth connected sensors as well.
Happy coding,
Cheers, Archie

@moritz89
Copy link
Contributor Author

@ozarchie Just to avoid confusion, the code in the hapifirmware folder is not equivalent to the one in hapinode. These seemed to be two different code bases, with hapifirmware being significantly smaller functionality wise. Is there a reason for the split between hapifirmware and hapinode?

What I did was move the code in hapifirmware/hapifirmware.ino to hapifirmware/src/main.cpp: git diff b693e3f..30bd4bb --stat -- src/dumb_module/arduino/`. I started moving the hapinode code, but it will require quite a bit of refactoring. Therefore, low priority and working on it iteratively (check the make_dumb_module_oo branch).

@ozarchie
Copy link
Contributor

The hapifirmware codebase is based on an early implementation of the system, using a proprietary protocol and usb connection. The hapinode code was developed for mqtt and wireless.

@moritz89
Copy link
Contributor Author

Cool and good to know 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants