createcandle / Candle-manager-addon

An add-on for the Candle Controller / WebThings Gateway. It allows you to upload code to Arduino's with the click of a button.
MIT License
5 stars 5 forks source link

Signal-Hub Menu Doesn't Do Anything #31

Closed Shaav closed 3 years ago

Shaav commented 3 years ago

I created a signal-hub with a touch-screen. Upload was fine; added as a "thing" fine.

However, when booted up, the touch screen shows a Menu button that doesn't seem to do anything. It flashes briefly when touched but nothing else happens. I assume that is not the expected behavior since I can't really find any description of where one is supposed to go from here, but based on photos I've seen, there appear to be menu options I can't get to and/or a "listening" screen?

And just to make sure I understand—once the signal hub has been added as a "thing" it no longer needs to be connected to the pi by USB correct? After that it should communicate with the Receiver using the Nano RFs right?

A simple example of recording / playing back a signal how what that looks like it terms of creating a webthings rule would be extremely useful even if only to make it clear when something is wrong...

createcandle commented 3 years ago

Yes, the menu should work :-)

in theory a quick single tap should show a menu with options to record signals, in order to be able to detect or replay them.

once the signal hub has been added as a "thing" it no longer needs to be connected to the pi by USB correct?

Correct, they should communicate wirelessly.

You could enable "advanced mode" in the Candle manager settings. Then while USB is connected (or just straight after uploading the code to the arduino), you can check out the serial log for any issues. It may be worthwhile to enable debugging in the arduino code too.

A simple example of recording / playing back a signal how what that looks like it terms of creating a webthings rule would be extremely useful even if only to make it clear when something is wrong...

If you are using a touch screen, the way to record new signals is to use the touchscreen interface.

If you disable the touchscreen, the thing should gain extra buttons that allow you to trigger this recording functionality instead.

Webthings rules do not play a part in normal operation. In the case that you're not using a touchscreen, then you theoretically could create a rule to trigger this code learning aspect. But it's not a fundamental aspect of how the device works. You don't need the rules functionality to operate it.

Shaav commented 3 years ago

Yes, the menu should work :-)

Little video: https://user-images.githubusercontent.com/1418184/107135510-a1a2bc00-68b8-11eb-9dc3-3a7a7784c5ed.mov

You could enable "advanced mode" in the Candle manager settings. Then while USB is connected (or just straight after uploading the code to the arduino), you can check out the serial log for any issues.

Hm. So I've flashed the Signal-Hub twice now and this has happened twice: now when I plug in the nano on the "Plug In Your New Device" nothing happens. When it happened before I just switched nanos. This error shows up in the log:

2021-02-07 03:16:52.484 ERROR : mysensors-adapter: child_id 1 already exists in children of node 2, cannot add child

Nevermind. Looks like there's something wrong with one of my cables.

Serial log says:

Hello, I am a Signal Hub.
Connected to gateway! 

Is there a command line method of dumping the serial log? Just tailing /dev/ttyUSBx seems to work.

When I touch "Menu" "MORE>" appears in the log. And actually if I touch at the very bottom of the screen it pulls up a new screen with "CANCEL>New signal". Neither of those buttons work either , but again if I touch right at the bottom of the screen, it progresses forward.

This is a log of quite a lot of random touching:

��
MORE>
entering delete last menu
>0
~
throwing away left over touch_screen_serial byte:7
throwing away left over touch_screen_serial byte:1
throwing away left over touch_screen_serial byte:175
throwing away left over touch_screen_serial byte:1
throwing away left over touch_screen_serial byte:86
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
�
throwing away left over touch_screen_serial byte:198
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:141
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
�
�
�
throwing away left over touch_screen_serial byte:239
��
~�
throwing away left over touch_screen_serial byte:239
�
throwing away left over touch_screen_serial byte:239
throwing away left over touch_screen_serial byte:239
~
throwing away left over touch_screen_serial byte:65
throwing away left over touch_screen_serial byte:1
throwing away left over touch_screen_serial byte:248
throwing away left over touch_screen_serial byte:239
__MENU
~I��~C��~E��~C��
�
>0
entering delete last menu
>0
~ d�~�f�~a�
�
throwing away left over touch_screen_serial byte:239
>0
throwing away left over touch_screen_serial byte:253
throwing away left over touch_screen_serial byte:239
>0

It may be worthwhile to enable debugging in the arduino code too.

K—don't know how to do that (will report back if I figure it out in the mean time). This is actually my first arduino anything... :P

If you are using a touch screen, the way to record new signals is to use the touchscreen interface.

Yup, awesome. And it's probably perfectly obvious when it's working, but mine's not and not know what it's supposed to do...

If you disable the touchscreen, the thing should gain extra buttons that allow you to trigger this recording functionality instead.

Ok, I will try that. Probably with another nano if I can't reflash this one at the moment!

Webthings rules do not play a part in normal operation. In the case that you're not using a touchscreen, then you theoretically could create a rule to trigger this code learning aspect. But it's not a fundamental aspect of how the device works. You don't need the rules functionality to operate it.

I think maybe I wasn't clear—I mean after it's learned a signal... So say, I have a door or window signal that goes off when it's open and the signal hub learns it. When it goes off then, the signal-hub passes that back to the webthings-gateway via Candle where I can trigger other events using rules no? I haven't found anywhere that tells me what that looks like... and again, maybe it's perfectly obvious once it happens, but not having any idea what that looks like in advance, makes it hard to know when it's working and when it's not...

createcandle commented 3 years ago

Once signals have been learnt you can indeed use rules to trigger them. Each learnt signal becomes a switch.

I wonder.. perhaps the screen's input coordinates are upside down (rotated 180 degrees). When you see the menu button, what happens when you touch the complete opposite part of the screen?

createcandle commented 3 years ago

I've re-added the option to rotate the screen, and have set it to rotated by default. Try reflashing it.

Shaav commented 3 years ago

That did it, thank you!

createcandle commented 3 years ago

Great to hear :-)