benkuper / BenTo

Official BenTo Light Props Show Authoring Tool
GNU General Public License v3.0
25 stars 7 forks source link

Hardware #10

Closed tjthejuggler closed 2 years ago

tjthejuggler commented 2 years ago

Great presentation at the ejc! Do you have any detail on the little hardware devices you showed there in the clubs with the accelerometers and everything? I thought you mentioned that it was all opensource but I cant find any details on the hardware.

niklasberlin commented 2 years ago

i can second that, great workshop at the EJC and i would also be interested in more info on required hardware and how to set this up, there should be a follow up workshop/meeting at the next EJC for more knowledge sharing and so on

at the Workshop you mentioned the "creator core" eco system from flowtoys but afaik this is not sold (yet), especially if i dont need the gyro or battery power a easier to get esp board would be usefull (lets think on LEDs integrated in a costume -> usb powerbank can be used as power source and easy to get ESP32 board as controller)

manuelmitasch commented 2 years ago

Hey TJ and Niklas,

you can find the current Arduino firmware here: https://github.com/benkuper/BenTo/tree/master/Firmware/BentoFlowCreator

Here you can find different configurations for different boards: https://github.com/benkuper/BenTo/tree/master/Firmware/BentoFlowCreator/src/common/config

The file config_protov2.h contains the config for the current Flowtoys Creators Clubs. The file config_tab_hoop.h contains an example config for the hoop that we built with the Creators Tab. The file config_simpleESP32.h contains an example of a simple ESP32 configuration.

The firmware is developed to run on ESP8266 or ESP32. If possible we always use ESP32 as it's the superior chip. In the config files you set a couple of constants (e.g. number of leds, type of leds, sd card pins if any, imu if any, etc.) that are then used in the firmware code. For quick prototyping I really enjoy the M5StickC board.

The LED library used is fastled. So you can use any LED type supported by fastled and set the constant LED_TYPE.

When you create your own config file for your board configuration, you then want to include and activate it in Config.h.

I hope this is enough information to get you started.
If you have more questions, I think the Bento discord server is the best place for them: https://discord.gg/Fdhf2dbT

niklasberlin commented 2 years ago

Thank you for your reply, i will look into it when i'm back home from the Trauner Juggling convention on monday

what is the difference to https://github.com/benkuper/BenTo/tree/master/Firmware/BentoFlow/src/common/config ? this folder looks a bit more up to date (last update a month ago compared to three months ago for the BentoFlowCreator)

yeah I prefer the esp32 as well and only use the esp8266 for legacy projects, the m5StickC looks intresting but is afaik EoL, I think i will look into the tinypico board (i think i have seen a config for this board in the BentoFlow folder) for future projects (small, integrated lipo charging, esp32, only thing missing imo is a gyro but i don't need this for my current projects)

thanks for the discord link, i havn't found it previosly, one small note: if i have seen it correctly the invite link is only valid for 7 days (at least there was a remark when i clicked the link on my phone) so it might be useful to post an unlimited link somewhere so that more people who are interested in this project can join the discord and participate in discussions

tjthejuggler commented 2 years ago

Wow Manuel! Incredible, thanks so much for all the info, looking forward to going through this. I had no idea there was a discord for it as well, so great. Thanks again!

manuelmitasch commented 2 years ago

Mhm... that is a very good question. To be honest, I have not properly noticed the BentoFlow firmware before. It seems like a platformIO version of the BentoFlowCreator arduino firmware.

When Ben, Daniel and I were last working together we tried to find a new more flexible structure for the firmware that would defer as much config from compile to run time. The idea was basically to allow configuration of boards after flashing of the firmware, e.g. changing LED strips or number of buttons without reflashing. Ben did the work in Bentuino and eventually hit some limitations. I'm afraid Bentuino is a dead end.

good catch on the discord link! I will update the readme with a link that is not expiring.

5ch4um1 commented 2 years ago

Hm, i am having problems with getting started as well. When i open the .ino file from https://github.com/benkuper/BenTo/tree/master/Firmware/BentoFlowCreator in the Arduino ide, it shows me just this:

#include "src/MainManager.h"
MainManager mainManager("1.2.4");

void setup()
{
  delay(50); //
  mainManager.init();
}

void loop()
{
  mainManager.update();
}

This does not seem very beginner friendly, i assume we'd have to download visual studio code to actually get started within a reasonable timeframe? Many open source projects that aim for the Arduino would simply offer .ino files that can be opened in the Arduino ide, but your folders all seem to include VScode project files and c++ code? This seems a bit unfortunate, especially since there are people who would rather not use microsoft products on their computer? Using the Arduino ide to compile and flash might also allow Linux users to flash their tools? My enthusiasm after hearing the talk at the EJC has definitely diminished a bit, if you want to attract more users, you might want to put a bit more emphasis on being truly cross platform, beginner friendly, and less dependent on VScode/Microsoft?

niklasberlin commented 2 years ago

VS Code is also available on Linux so you can flash your tools also with this operating system. Microsoft’s vscode source code is open source (MIT-licensed) but the official build contains some telemetry/tracking code but because the code is open source people have build a version of it without the tracking, you can find it along other information at https://vscodium.com/ (they also have a linux build)

If you want you could also fork VSCode and maintain your own Version of it where you have full control over it and not depending on Microsoft.

EDIT: Oh and I'm suprised you don't complain about the use of Github (which is owned by the evil Microsoft) instead of something like Gitlab (which is open source)

With a Project so complex as this firmware development in the arduino IDE is just a nightmare because organising of code is way harder in the Arduino IDE. In the end it is just an IDE that feeds the files to the same compiler as VS-Code with the platformIO extension. By the way the Arduino IDE also supports C++ Code and many Arduino librarys use C++.

The .ino file you quoted is correct, it includes the MainManager which includes other parts depending on the config file. The Config files can be found in src/common/config/ the config.h file is basicly only used to include the correct config file depending on what prop you have (different props require different configs, e.g. different Hardware Layout, different number of LEDs, ...). The config for the different props is done in the config_XXXXX.h files where XXXXX gives you a hint about the prop (these files are then includes in config.h).

In BenTo there is an option in the global settings to link to your arduino install and to the firmware and use BenTo to handle all this in the Background to make it as easy as possible for beginners to flash their props (but i had no time to test the flashing, neither with BenTo nor via the Arduino IDE nor via VSCode so i can't give detailed tips on this yet and i don't have an ESP with me to test it right now)

5ch4um1 commented 2 years ago

Hm, i'm still not convinced by that microsoft ide. Tried to install platformio with pip now and did a platformio run in the two folders that had a platformio.ini, this installs some libraries, but then gives some errors when it compiles. Do you have anything that would work out of the box with just platformio-core?

And, well, we are talking about a firmware for light props, shouldn't this still somehow be within the realm of complexity that would justify using just a few files and the Arduino ide? If you don't have something that compiles on a rather standard (L)Ubuntu 20.04 without installing VScode, then I'd rather learn more about osc and how it is implemented in bento and write a very simple arduino sketch myself.

manuelmitasch commented 2 years ago

@5ch4um1 There is an Arduino firmware that you can upload with the Arduino IDE. Yes, the structure of the firmware looks more complex than a regular Arduino sketch that controls LEDS. The reason is that this firmware can do much more than simple LED control. It's well designed and we have invested a lot of work into how to make it powerful and flexible. This has been a process of 4 years and several iterations.

If you prefer to roll your own firmware, well, why not. You will learn new things, which is nice. I have done it and tried it. It's a very hard task to make something that is anywhere near as powerful, let alone cleanly developed as the Bento system.