[BETA] Wink Relay - Custom SmartThings Integration

android
dth_lighting
dth_sensors
project_sensors
winkrelay

(S H) #165

Which bottom button? i use the tiny reset button only when it has already crashed and is frozen. Is there a another button you are talking about?


(Joshua Lyon (SharpTools.io Dashboard)) #166

I mean the buttons on the right side of the Wink Relay which you can map to take actions. If it’s what I think is happening, the Wink Relay itself is actually still running. It’s the STWinkRelay app which has been closed.


(S H) #167

Yes I have used the bottom button. The bottom button is not connected to a load, so i have used it to map a smarthings routine. It’s the reason I am using this app. So you are saying if I use that button this app will crash?

i guess I will try to put a link to the app on the homepage and see if I can activate the app that way. Wife will not like it though.

Is this something that you think can be eventually fixed?


(Joshua Lyon (SharpTools.io Dashboard)) #168

Yes, it bothers me too and it needs to be fixed. I spent several hours troubleshooting it, but couldn’t get to a root cause. It’s a mix of Java / C++ code (JNI), so that makes troubleshooting it even more of a headache.


(The Viking AKA "Holy Crap You're a Giant!") #169

My issue as of a week ago is that my Wink goes to a solid white screen and freezes, or it freezes at the home page, or it goes non-responsive because the wind blew in China after a butterfly farted.

The side buttons go non-responsive at the same time and I am not able to do anything with the unit. I’m tempted to do a full wipe on it, re-root it and start fresh.
I have two more units I purchased when I wrote the original documentation that I planned to sell as rooted units, but I never shipped them out. I think I’ll get them set up the same way and find a spot to install them.


(Joshua Lyon (SharpTools.io Dashboard)) #170

I feel your pain. This is one of the more finicky devices I have… I’m tempted to swap my primary unit out for a modern tablet.


(The Viking AKA "Holy Crap You're a Giant!") #171

How are your ROM building skills? lol

A new Android Lollipop or Nougat build on this would likely resolve most of the issues.


(James) #172

Just throwing this out there. I have two of these relays.

One, I did a hard reset, rooted it, let wink update and then installed your software. It works great.

The other, I did a hard reset, rooted it, installed your software and suppressed the wink app. It crashes when the bottom button is pushed sometimes.

It’s possible that there was a firmware/bios/android update in the wink update that fixes an issue with the bottom button.


(Joshua Lyon (SharpTools.io Dashboard)) #173

It’s possible, but from my troubleshooting it was an issue with the JNI handoff. In my code, I spin up a service for watching for the buttons and that service spins up a JNI thread to watch each button. Android pretty aggressively manages memory and normally when it tries to shutdown threads it expects the thread to respond pretty quickly or it thinks the thread is hanging and force kills it. With the JNI it’s not supposed to do this, but something weird is going on with my references.

If I change the code to only spin up a single thread to watch the bottom button (and don’t spin up the thread to watch the top button), the code will never crash. From what I can tell, both instances are trying to reference the same memory reference somewhere along the line and it’s tripping things up.

Edit: If someone is a JNI expert, I would happily take your feedback. :stuck_out_tongue:


#174

Welp my Wink Relay decided to break itself somehow. I had everything setup, some nice webcore routines going. No problems with it, I could even install and uninstall stuff, without it forgetting my settings on reboot. I know some people were having trouble with that. Now this morning I get a popup “Please buy the key to support this project” and the relay reboots over and over. Displaying that message. Every now and then I can get into settings before it reboots, but if I disable or uninstall things they just come right back. So I guess I’m having that issue now.

I would do a factory reset on the Relay. But when I ran Kingroot I clicked the [Optimize] button because I’m dumb. My understanding now is that causes the device to brick if you factory reset it.

It’s too bad, this was a fun piece of hardware, and filled a blank spot on my wall. It would be nice to figure out what keeps popping up asking for a key, and crashing my Relay. I don’t have many apps, so my main suspicions are KingRoot, Multi Action Home Button, or Total Launcher.


(Joshua Lyon (SharpTools.io Dashboard)) #175

Do you have ADB setup? If so, you could try killing/disabling those apps as soon as the Wink Relay starts up. Unfortunately, if you are having the “Groundhog Day (movie)” event, it will only be temporary. :confused:


#176

Yeah it winded up being Total Launcher. I used adb to kill the process and it stops looping. Of course it’s only temporary, until the file system reverts again. It’s such a strange problem. I wonder if there is some kind of file system corruption, and that’s causing it to load the partition in Read Only mode. The only fsck on the device is fsck_msdos, which isn’t very helpful. I don’t have enough linux knowledge to go any further than that.


(S H) #177

I am using total launcher as well but haven’t experienced what you are experiencing. Should i uninstall it and use something else? i thought Total launcher is free.


#178

Nah, You are probably okay to use it. I think whatever other problems my relay has are causing it to bug out.


(James) #179

Welp… I was having trouble with one of my relays so I did a factory reset. It wouldn’t go to the android launcher, so I did a wipe/reset, when I tried to do a factory reset again it says Edison.zip is missing… Looks like Wink stealth deleted it on me. Now I have a unit that won’t boot. Just says WINK RELAY on the screen and works as a dumb switch…

EDIT: Doesn’t even work as a dumb switch anymore. FML.


(The Viking AKA "Holy Crap You're a Giant!") #180

I’m in the process of doing some serial recovery on two of mine… Once I am successful, I’ll write up documentation on it.

This unit was one of my non-responsive units that the edison.zip file would fail the validation check.


#181

Oh my gosh! I didn’t think you could flash new firmware over the serial connection. I saw the option in the recovery menu for flashing using ADB over a USB connection. Is that what you used? I’m really looking forward to your guide.

Running dmesg confirmed that the file system on my Relay is corrupted. And I was even able to get a working version of fsck on the device. But can’t run it while everything is mounted. So looks like reflashing the firmware is my only option left.


(The Viking AKA "Holy Crap You're a Giant!") #182

Transferring files via Serial is nightmarish, at best. I was able to get the system up enough to get ADB working.
I’m working through some of the stupid little issues, such as getting root working properly so that I can mount the folder that edison.zip is in.

A lot of the time, when it is stuck at the WinkRelay logo and just sits there without even cycling anymore, you can run a command against the serial line and it will force load the Android home screen. From there, a quick tap on the app drawer, some wireless settings, then some debug menu settings and you now have ADB over wifi.


#183

Mine is not stuck at the WinkRelay logo but I can’t install or uninstall anything at this point, as soon as the wink reboots it reverts back to the previous settings even the factory reset doesn’t work anymore. I thinking this method you have might help me do a fresh instal and start back from scratch


(James) #184

If you’re willing, I’d love to send my “dead” one to you to be reinitialized. I don’t have any real experience with Android so I’d have to buy the correct cable and figure all that out.