Onixarts / Hapcanuino

Arduino based modules for Hapcan Home Automation Project
4 stars 2 forks source link

LInking Hapcanuino devices #21

Closed gkasprow closed 6 years ago

gkasprow commented 6 years ago

@Onixarts I posted this issue on HAPCAN forum already I managed to compile HAPCANDUINO, made it running on Arduino Pro Micro with attached CAN controller. It is now visible under HAPCAN Programmer as ordinary UNIV3 relay module. I can control LEDs connected to MCU ports with commands Turn on/off/toggle. I can even read processor EEPROM and I see there the name I assigned. I cannot read FLASH and get error. Then I tried to configure and link devices, I cannot read it - it displays error (below) when I click Read. Of course I cannot link devices. And the question is if I do something wrong or some additional EEPROM access need to be done. Here https://github.com/Onixarts/Hapcanuino/wiki/EEPROM-handling is brief description how to do it, but I don't know the system enough to be brave to try it :)

obraz

Onixarts commented 6 years ago

@gkasprow, currently You can't read hapcanuino flash using hapcan programmer, because hapcanuino is based on Arduino and the code do not follow the original PIC hapcan's processor memory structure. The eeprom can be read, but the original addresses are converted by hapcanuino to fake programmer, that it talks to original hapcan module. So in case you want to update firmware in hapcanuino You have to connect it via standard usb connection.

There is one more difference, the boxes are stored in eeprom, not in flash like in univ3. Because of that I have to made boxes using different (smaller) struct, so I can put more boxes in 1kB eeprom. But I think I will change that in nearest future sacrifice box count. Currently the only way to program the boxes is to use eeprom editor in hapcan programmer. To make it easier I have started a new project called hapcan programmer 2. But it is not finished yet.

gkasprow commented 6 years ago

@Onixarts Thanks! How can I contribute to the development? I can assign one of my skilled students that would do some useful work instead of doing useless project at the university :)

Onixarts commented 6 years ago

Excellent idea. Well, I think the huge contribution in developement is needed in Hapcan programmer. Current (the original) programmer is written in Delphi, and the sources are closed. The solution that I've started is written in C#, using WPF, MEF and caliburn micro framework. My goal is to build new, modern programmer app with plugin support, so all original Hapcan's modules can be supported by the plugins. Also, the new, custom devices using Hapcanuino or original UNIV3 PIC processor could have their own plugins for new programmer so it can be simply used, just like regular ones. The sources are here. I think this could also be written in JS framework, so it also could be used on Linux or Mac systems. The plugin development should be easy enough, so people with low programming skills can write their own solution, just like they make own Hapcanuino based device (aquarium controller for example).

gkasprow commented 6 years ago

We could go even further. Let's make it all graphical. So once all devices are recognised, we can arrange them on the desktop and can draw connections - links between them. Further, we could draw some graphical boundaries that illustrate house arrangements. It is far more intuitive than text-based approach. And current amount of details is not helping much, they should be hidden. My students already did such thinks to help biologists setup the electronics in intuitive way, so there are some tools already available.

Onixarts commented 6 years ago

I guess it would be great. But I would leave graphical wiring tool for later (keeping in mind) and focus on target users needs. There are two groups of users. Group one, has the original modules, and maybe some custom, but they can't really build one alone. They're just a typical system users. The second group is users that has some skills, so they can build Arduino based module with some external devices connected and they wan't write a plugin for programmer so make configuration easy. The second group don't need graphical tool, because they wan't have some more control over code I think :). P.S. maybe You want invitation to my slack workspace? Send me e-mail on software at onixarts pl.