ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 2
VIEWS: 409
BACK
REPLY TO THIS POST
Gizmo
06 Apr 2024
New Feature - ChipChop Code Builder



The ChipChop Code Builder for ESP32/ESP8266 is a new major upgrade to the Dev Console. It has been tested by a number of users and it's now available for everyone to use.

The Code Builder is almost an entire system on its own and has taken some serious time to develop so I hope you will enjoy it and find it useful. The system architecture is designed around a "plugins" or almost "apps" concept and it's no longer heavily "library" oriented.
In essence, what the Code Builder produces as a final result can be considered as one giant library that has no specific version. Depending on the choice of plugins/apps that you include it will be unique to your project.

The base engine is still the core ChipChop Library with the working version 1.4x and you no longer need to keep track of what is new and keep re-downloading the library as the latest version will always be automatically included. With the introduction of the plugins architecture most of new features, improvements and expansion of the capabilities will come through the plugins removing the need to constantly modify and expand the core engine.

The ChipChop library will stay available for download as a standalone engine for those that need it or want to develop their own system architecture from scratch.


Brief history

As ChipChop is becoming a more and more complex system I keep getting bombarded by emails with similar questions. The story is almost always the same:

    1. You are new to this IoT stuff
    2. You are still learning programming
    3. You want to stop buying off-the-shelf "smart home" crap
    4. You want to make smart things that work the same way or better than the off-the-shelf "smart home" crap
    5. You don't understand why is it so complicated when ChatGPT says it's easy!?
    6. You want it now
    7. You want it for free

To my annoyance I have been left with no choice, either I tell you to go to the place where unicorns can do what you are asking for 🦄🌈 or to easy you gently with plenty of lube into the IoT world. Sadly, I picked the second option and to get you off my back I've started developing the Code Builder.

What is it?

- The Code Builder is an additional sub-system of the Dev Console. It's aware of your devices and components that you use on each device.

- It's designed to automatically generate c++ template code for you that can be loaded and compiled on your device with PlatformIO or Arduino IDE

- The code generated leaves plenty of space for you to add additional logic and functionality in the same way as you would using Arduino framework

What it's not

- The Code Builder is not a compiler although it may evolve into one in the future. You still need to use PlatformIO or Arduino IDE to compile and push the code onto the device but it's a very simple process and requires only couple of clicks

- It's not an IDE. Although you can build some devices without writing a single line of code and the goal is to grow the plugins library to cover many peripherals and sensors you may still need to do some hands-on coding.


How to use

Using the Code Builder should be simple and self explanatory but here are just a few pointers to get you going.

1. In the Dev Console > Devices section you will find for every device a big "Code Builder" button (you really can't miss it). This will get you into the Code Builder section (also available from the main menu) with the device pre-selected from the list.



2. Pick the correct microcontroller type from the menu or alternatively if you have built a project before you can upload the Code Builder file and continue to the plugins selection screen.

3. Add/remove the plugins you want to use. Each plugins comes with a brief explanation on what it can do and any usage notes you have to be aware of.

4. On the next screen go through each plugin, tweak any settings if you need and make sure to press "Save" every time.
Some plugins don't have just default setting but also require entering some setup information so reviewing each one and saving its settings is necessary.
note: You can not proceed to the final step if you haven't confirmed and saved the settings for each plugin.

5. Select the IDE you want to generate the code for and the Code Builder will generate a zip file with the entire ready to use project that can be opened in PlatformIO or Arduino IDE



You can of course go back at any time and tweak any of the settings or you can even generate the code for each IDE separately.

IMPORTANT Make sure to read the instructions.txt that comes with each project. There are major differences between PlatformIO and Arduino IDE builds and due to the Arduino IDE limitations you may have to do few additional steps in order to use the generated code (it's nothing major, mostly things like installing any additional libraries that may be needed)
PlatformIO projects should contain everything and may just require having a quick check of the platformio.ini that it correctly matches your board details.


That's it, have a play, experiment and post questions in the forum if you get stuck or are not sure how to use the Code Builder.

I will be creating more plugins and if you need something specific just ask.

Enjoy



Attached images
summocoder
10 Apr 2024

hi G, been looking at this Code Builder of yours and like the idea of plugins. I have made some simple classes before and it would be good if I can tap into this plugin mechanism so things can "talk" to each other.

I can see that you have some sort of inter-messaging between the classes and it all works but I can't even figure out the entry point let alone all that emit, addlistener, events, lambdas/callbacks? Do I dare ask if there is some docs (I'm bracing myself for your response 🔫 😵)
Gizmo
10 Apr 2024

Docs? Docs are overrated, where's the fun in that ;-)

On a serious note, I am still tweaking stuff so there is no point writing detailed dos at the moment as things could slightly change but I'm happy to guide you (then you can write the docs...thank you for volunteering 😂 rookie mistake buddy )

Actually it's not that difficult if it's making a plugin for yourself, different story for public distribution inside the Code Builder that's a heck of a lot more involved.

Hmm, not entirely sure where to start, maybe easier over a remote session like last time? Ping me an email with some times (preferably the weekend) and we'll trash it out in 20 mins, maybe just prep a simple class you want to convert into a plugin