Hardware Connection Help #18
Replies: 6 comments 3 replies
-
OK, great. Bringing up the Arduino hardware & firmware will be documented here: https://github.com/xtech/self-o-mat/wiki/Controller-board Either I don't understand this piece of code or if not needed, the
|
Beta Was this translation helpful? Give feedback.
-
Hi, could you please add some information about command encoding? If I get it right, it's not only plain characters being sent over the line: https://github.com/xtech/self-o-mat/wiki/Controller-board#serial-commands Edit: BTW, I've added a state diagram for the SelfomatController's firmware. Cheers |
Beta Was this translation helpful? Give feedback.
-
Thank you for your work! The communication between the Arduino and the host software is basically COBS encoded Wiki. The only difference is that we can't use the 0 byte as delimiter, because of issues with the boot loader. Therefore I used the space character as delimiter. For decoding and encoding I am using the PacketSerial arduino library https://www.arduino.cc/reference/en/libraries/packetserial/. With the encoding done, we can talk about the packet format. For example the "accept agreement" command simply consists of the command 'a' followed by a space character ' '. The "write settings" command consists of a '$' byte and is followed by sizeof(settings) bytes of data. The settings datatype is a struct which holds all settings of the self-o-mat controller board, the last two bytes in the struct are used as CRC checksum. Finally a space character ' ' needs to be sent in order to finalize the packet. Nice work on the state diagram, but it does seem to miss some transitions (we can not get back to the OffState for example). Additionally the first transition is wrong: PIN_SWITCH == HIGH should go to OffState whereas PIN_SWITCH == LOW should transition to the BootingState. |
Beta Was this translation helpful? Give feedback.
-
BTW did you get the connection to work? Can you now use the software as intended (live camera preview, trigger photo, web app)? |
Beta Was this translation helpful? Give feedback.
-
Yes, there are transitions missing from ShutDownState (and all other states which return true for needsHeartbeat()) to the OffState. It happens on heartbeat timeout. The code for this is found in the main file in line 115.
I'm glad to hear that you are making progress! Hopefully you'll get a nice working photo booth soon!
Yes, that would be nice, although I'm not sure if it's worth the additional work. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update and for pointing me to those transitions - I really had overlooked them as I was concentrating on the state-specific code. The state diagram is updated and getting messy. It may need some improvement but it seems to be a good starting point. I agree with the estimated additional effort it would take for the component testing approach. |
Beta Was this translation helpful? Give feedback.
-
@maehw
if you need infos how to get the hardware to connect, just write here.
some things I just remembered:
/opt/.selfomat.type
. The file needs to contain a string for the type of box that is currently running. Then the software loads the box specific settings file from the ./settings folder in this repository.Beta Was this translation helpful? Give feedback.
All reactions