PDA

View Full Version : DIP_TOH -- lots of toggles! -- sold out!


dirkvl
2014-06-17, 14:45
Chronological path of activities
1. Jolla updates Sailfish OS, toggles in lock-screen customizable
2. Software tutorial (http://www.itbackstage.de/2014/06/14/jolla-toggle-bluetooth-kind-of/) is made for BT toggle in lock-screen
3. Kimmo sees picture in tutorial, grabs some electronics (http://www.youtube.com/watch?v=sqnLLhyeo6M&feature=youtu.be)
4. Dirk (#me) thinks of a way to expand this idea into a product and posts a new thread.

Concept
So now we are here. Using my paint skills I have made this:
http://oi61.tinypic.com/53ps2h.jpg
Six toggles on the back of the phone, fully configurable. Also, one hidden button, usable as camera shutter (but more on that later).

Goal of thread
In this thread I would like to show progress in this project and poll the demand. Use the options above to show your interest, I will determine if I will make some, or a lot.

Costs: 45E (updated 15-8)
-below 50, as requested (http://talk.maemo.org/showpost.php?p=1435612&postcount=29)
-sum of materials (30) + R&D (15)
Profits will be used to buy some bread and develop moar stuff

Colors
- White, Blue, Red, Purple, Yellow, Pink, Green, Orange
- Black, Alumide (+3E)

Project planning
Sending PCBs to board manufacturer -- check
Ordering parts -- check
Delivery boards -- first half of July --check
** summer (http://www.moulay-bouzerktoun.com/) holiday (https://lh6.googleusercontent.com/-Xp1DrtM144g/URptgvHpd9I/AAAAAAAAEHA/NHGaBsryuM4/w800-h800/moulay_bouzerktoun10.jpg) all of July **
Fitting OH around PCB -- first halfish of August
Sending OHs to new owners -- first half of September

Challenge
To minimize added thickness, all the components will go on the phone-side of the pcb (except for the switches ofcourse). The available space is located in the cavity below the microsd slot. This gives me 9*15*1mm to fit all components.The components so far: eeprom, gpio, sensor controller, voltage regulator, 3 caps and 2 resistors.
http://oi57.tinypic.com/2ihqeqb.jpg

What to do with toggles?
- BT on/off
- Silence
- 4G on/off
- Wifi on/off
- Alarm on/off ?
- Specific daemon on/off
- Max/min screen brightness
- What would you want?

What to do with invisible touch button?
- Camera shutter
- Answering calls
- Pause music
- What would you want?

FAQ
Do you wanna know how many phones I have? -- No
Let me tell you about my experience with Win8.1! -- No
Add keyboard/battery/infrared/laser/selfdestruct/etc! --No
Howso people if now humens cuz ima gerl blable why not?!! -- Thats not english.
I uses to have a phone with buttons! -- Cool..

Buyers
Okay, so first 6 DipTOHs for 45:
-Rauha
-Kabouik
-MemphisX
-Koiruus
-MartinK

(2nd batch of 6)
-d0n_Egg1 -> Red
-carton
-Koiruus
-Cybette
-asys3
-haliava

nieldk
2014-06-17, 15:13
Sign me up, NOW :)

Mikkosssss
2014-06-17, 16:11
I think you should have this on TOHKB2 too.

dirkvl
2014-06-17, 16:38
I think you should have this on TOHKB2 too.

You are not a strong reader are you?


FAQ
Add keyboard/battery/infrared/laser/selfdestruct/etc! -- No


#no (https://www.youtube.com/watch?v=FshkO8HqQ10)

Thoke
2014-06-17, 16:54
Since I answered the poll "No, I want moar functionality", let me explain my reasoning. I think this feature could go very well with eg TOHOLED, but I don't think I'd buy it if it was the only feature, even though it is a cool feature. I know it's hopeful thinking to add this to TOHKBD (by judging the response of dirkvl), but coupled with TOHOLED, I'd probably buy it.

I don't think it would even make the OLED Other Half any thicker, judging by the picture, and there would even be synergy between functionalities, with OLED having the capability to show what was toggled on/off (this probably needs community coding effort). That would be neat. :)

Mikkosssss
2014-06-17, 16:54
I didint ask you to add keyboard to this. I asked you to add this to keyboard too. :)

dirkvl
2014-06-17, 17:15
I didint ask you to add keyboard to this. I asked you to add this to keyboard too. :)
I think this feature could go very well with eg TOHOLED

you are both in the wrong thread ;) but to answer you both:

Important in developing OHs
- Keep it simple
- One step at a time

Timeline in developing über-oh:
1. build everything separately
2. test and review everything separately
3. combine features

Adding stuff to keyboard-oh
Development of the keyboard otherhalf is a lot more complex and so will take more time and more developments costs. Adding untested features to this will increase development costs, delay release date by extra troubleshooting and will reduce the chance of it ever be completed.

Asking for stuff to be added to keyboard
As stated in the keyboard thread (http://talk.maemo.org/showthread.php?p=1424569#post1424569):

-Use this thing/component/whatever!
Send this kind of messages over PM
Just posting it here is -just like steering you car into oncoming trafic- counter-productive (http://www.youtube.com/watch?v=jZyIDIDnzq4&t=6m6s). I am thinking of ways to improve the keyboard every day, you can suspect I've already thought adding this. Having to explain this over and over is not helping me whatsoever.

Conclusion
In both my threads I have stated clearly what my intentions are for adding functionality and have suggested what to do if you can't fight the urge to shout 'keyboard!'. I understand everyone wants the 'über-otherhalf', but can only be the result of a long iterative process (stated above). I do not have the time, manpower, knowledge and dough to do this overnight.

Thoke
2014-06-17, 18:08
Yes, understood. With one-man-business it's hard to develop the Dream Solution many of us yearn for, except with continued financial support and patience from us to wait for it.

I guess it sort of brings us down to earth with our immediate expectations. And that is good. Keep up the good work.

minimos
2014-06-17, 19:04
Instead of 123456 under the toggles can haz have QWERTY ? :p

kimmoli
2014-06-18, 06:47
And the software for this might be something like ShellEx, but with possibility assing a shell-script/command to each toggle;

switch 1 to on: Start bluetooth
switch 1 to off: Stop bluetooth
switch 2 to on: Silent
switch 2 to off: Voices on
switch .... and so on

dirkvl
2014-06-18, 07:31
First board rendering! 6 toggles and an area to be used as shutter button on the back of the phone. Have always found it awkward to use my thumb for the onscreen shutter, think this will be more natural.

http://uploads.oshpark.com/uploads/project/top_image/1SFizQ4r/large_i.png
http://uploads.oshpark.com/uploads/project/bottom_image/1SFizQ4r/large_i.png

dirkvl
2014-06-18, 07:45
Also, the BOM is complete so I can make a more accurate estimate of costs. First estimate was a bit on the safe side, think I can make this OH for 45 for small batch (<10) and 40 for larger (=>10). Updated in first post.

Koiruus
2014-06-19, 18:52
This is also a WIP issue, but I was just thinking about the location and functionality of the dip switches. Like, how easily they switch their position. Because, if you have tight jeans for example, you will maybe get accidental switching. Another thing is usability with covers and so on.

Yes, I think you have already thought this issue. And no, I don't have any ideas on how to solve this. But yes, I'm interested and I think 50€ is okay.

dirkvl
2014-06-19, 19:33
if you have tight jeans for example, you will maybe get accidental switching

my jeans are generally not that tight! ;)

but i don't know if this will be an issue, because the switch i will be using is totally new to me!

dirkvl
2014-06-27, 08:54
6 boards are on the mail -from the usa- so ordering parts today! 4 boards will be available for sale, if it all works.

dirkvl
2014-07-01, 16:50
Some parts are in - all except for back-ordered switches itself.

This is a GPIO expander, cant believe how tiny it is!

http://oi60.tinypic.com/10ihqwk.jpg

juiceme
2014-07-02, 06:46
Some parts are in - all except for back-ordered switches itself.

This is a GPIO expander, cant believe how tiny it is!

Love to see ya hand-soldering that... :D
(I have done it, what you need is a good microscope, flux and very tinypointed smd iron, but you do not do many of these in an hour...)

kimmoli
2014-07-02, 06:51
With good flux, no need to have so small irontip, just solder one pin, then flux, then some solder on tip and start from other side if chip, and just swipe with iron over the pads...

Or paste with little extra flux and hot air (or bbq-reflow).

Making large via middle of thermal pad makes soldering easier (also rework gets easier, at least with multilayer boards)

TemeV
2014-07-03, 13:19
With good flux, no need to have so small irontip, just solder one pin, then flux, then some solder on tip and start from other side if chip, and just swipe with iron over the pads...


I usually even prefer bigger irontip, because it releases the heat faster. This way the heat stays "local" and internals of the component are not unnecessarily heated. With good flux and well made solder mask there usually aren't any solder bridges.

nokiabot
2014-07-03, 15:41
With good flux, no need to have so small irontip, just solder one pin, then flux, then some solder on tip and start from other side if chip, and just swipe with iron over the pads...
Or paste with little extra flux and hot air (or bbq-reflow).
Making large via middle of thermal pad makes soldering easier (also rework gets easier, at least with multilayer boards)
yep this works i solder many things like this

dirkvl
2014-07-08, 13:14
https://pbs.twimg.com/media/BsBjq2DIYAA48Nr.jpg

will solder in beginning of august

kimmoli
2014-07-08, 13:18
https://pbs.twimg.com/media/BsBjq2DIYAA48Nr.jpg

will solder in beginning of august

I did read let the soldering begin :)

(I would have some time start making the app (and even solder one))

dirkvl
2014-07-08, 13:46
I did read let the soldering begin :)

(I would have some time start making the app (and even solder one))

all components in except for the switches itself, so patience!

kimmoli
2014-07-08, 13:49
all components in except for the switches itself, so patience!

Yeah. I will advance some other toh project meanwhile.

dirkvl
2014-08-10, 00:35
Since I am too busy printing a million orders from FunkyOH, decided to let Shapeways handle this project.

One TOH to test will be here in two weeks, then people can decide if they also want one and I can order moar!

http://oi60.tinypic.com/2lcqmxi.jpg

dirkvl
2014-08-12, 10:36
6 PCBs soldered and tested. Thanks to Kimmo for providing me with some software!

Phone can track the position of the toggles, next step is to link them to phone settings, such as wifi, bluetooth, tethering, etc.

Also, achievement unlocked: soldering 2x2mm chip with 0.5mm pitch without solder stencil!

http://oi58.tinypic.com/13yms6p.jpg

dirkvl
2014-08-12, 21:38
- In the poll there are 8 people that seem interested
- I do not get a lot of responses in this thread
- I now have 6 PCB's

Should I order more? Not a wanted feature or is everyone waiting for a video? :p

jalyst
2014-08-13, 08:57
I'm waiting for the proverbial "kitchen_sink TOH" that combines many (if not all) of your/Kimmoli's TOH projects, + Moar ;-P
But, both of you should keep them all "laser focused" for now, refine them all, learn from them all etc...

Rauha
2014-08-13, 09:14
- In the poll there are 8 people that seem interested
- I do not get a lot of responses in this thread
- I now have 6 PCB's

Should I order more? Not a wanted feature or is everyone waiting for a video? :p

I'm one of the 8 and still interested, as long as € ≤50

kimmoli
2014-08-13, 12:45
I'm one - at least i need one or the R&D

Kabouik
2014-08-14, 23:26
I'm interested too.

dirkvl
2014-08-15, 11:55
Okay, so first 6 DipTOHs for 45:
-me (R&D)
-Kimmo (R&D)
-Rauha
-Kabouik
-MemphisX
-JollaHQ

Next batch (per 3):
-

First test case should be here within a week #shapeways (http://oi62.tinypic.com/332vu6a.jpg)
Will send payment requests as soon as I have an acceptable result :)

Cost will be 45E
-below 50, as requested (http://talk.maemo.org/showpost.php?p=1435612&postcount=29)
-sum of materials (30) + R&D (15)

MemphisX
2014-08-15, 13:17
Count me in... and take my money :p

dirkvl
2014-08-19, 15:22
Ordered 6 extra boards, will not make more than that. I consider all 12 owners to be 'testers', to see if feature has to be added to the infamous 'kitchensink TOH'

Okay, so first 6 DipTOHs for 45:
-me (R&D)
-Kimmo (R&D)
-Rauha
-Kabouik
-MemphisX
-JollaHQ

Next and last 6:
-Koiruus
-MartinK
-d0n_Egg1
-
-
-

jalyst
2014-08-19, 16:14
If only the Jolla was officially offered in Oceania/SEAsia, I'd prolly have one by now & would most likely contribute.

tommo
2014-08-19, 19:26
If only the Jolla was officially offered in Oceania/SEAsia, I'd prolly have one by now & would most likely contribute.

There's been a few for sale here, u should try those.

jalyst
2014-08-20, 04:48
Not interested until it's "officially" available in Oz, or somewhere in Oceania/SEAsia at the very least.
There doesn't even have to be a strong local distributor/reseller presence, just make it officially available.
Anyway we digress...

dirkvl
2014-08-20, 19:00
Available colours are:

White, blue, red, purple, pink, yellow, green, orange, black (+3E), Alumide (https://images3.sw-cdn.net/model/picture/625x465_2395809_4502628_1408374133.jpg) (+6E)

Will contact interested people when ordering, but think about what you want in advance ;)

Koiruus
2014-08-21, 01:36
I would be also interested (as I said earlier). So count me into the next batch.

MartinK
2014-08-21, 08:13
Count me in! :)

d0n_Egg1
2014-08-25, 06:06
if there is still one TOH available i would be interested in one too :D

dirkvl
2014-08-25, 14:27
On the list.

First proto shell from Shapeways is on the way, should be pics/video in a few days!


Edit: next 6 PCBs are shipped (from US) and first case arrives tomorrow!

dirkvl
2014-08-26, 16:52
Pics in Dropbox (http://goo.gl/C2yutY)

Could these people please contact me about shipping and payment (e.g. address and paypal mail)? Also, let me know what colour (http://talk.maemo.org/showpost.php?p=1436422&postcount=38) you want!
info at funkyotherhalf.com

(1st batch)
-Rauha
-Kabouik
-MemphisX
-Koiruus
-MartinK

(2nd batch of 6)
-d0n_Egg1 -> Red
-carton
-Koiruus

(three more for sale)

kimmoli
2014-08-26, 19:30
About the application: How would you like this to be configured?

It will be a daemon running as systemd service.

I was thinking that first approach would be simple; a directory with 12 shell script files which are:

sw1on.sh, sw1off.sh, sw2on.sh, sw2off.sh, ....

sw1on.sh is executed when dip 1 is turned on
sw2off.sh is executed when dip 2 is turned off

The UI would then be just for editing these scripts.

Daemon would run either as root or nemo, but there is issues with both accessing certain things of phone. Might need some consultation.

Comments?

cartron
2014-08-26, 20:26
Ordered 6 extra boards, will not make more than that. I consider all 12 owners to be 'testers', to see if feature has to be added to the infamous 'kitchensink TOH'

Okay, so first 6 DipTOHs for 45:
-me (R&D)
-Kimmo (R&D)
-Rauha
-Kabouik
-MemphisX
-JollaHQ

Next and last 6:
-Koiruus
-MartinK
-d0n_Egg1
-
-
-

Hi, I am interested as well by the next batch ! :)

Koiruus
2014-08-26, 22:51
About the application: How would you like this to be configured?

Sounds nice to me. And I think that I wouldn't be changing the actions of the switches all time, so I think that just modifying script files would also be okay (if someone makes a tutorial :)) But a GUI would be nice.

dirkvl
2014-08-29, 07:51
first 4 payment requests are out! cases are ordered and will arrive here in +-2 weeks, sent to new owners +-3weeks from now

if you are on the list, send an email to info at funkyotherhalf.com containing
- your paypal mail
- address
- preferred colour
(White, blue, red, purple, pink, yellow, green, orange, black (+3E), Alumide (+6E))

if you also want one, let me know, there are i believe 2 left.

asys3
2014-08-31, 14:49
I would want one, too.
Could you please update the list to make sure I get one ? ;)

cartron
2014-08-31, 19:27
@kimmoli: I like this approach, very simple and yet powerful.

dirkvl
2014-09-04, 15:43
which idiot ordered black??

http://oi61.tinypic.com/nv2m81.jpg

ordered all parts for all DipTOHs, will soon update list with people who ordered/payed/colour

dirkvl
2014-09-04, 17:30
paid:
d0n_Egg1 -> Red
MemphisX -> White
Kabouik -> Pink
Koiruus -> Black
cartron -> Purple
asys3 -> Black
haliava -> Alumide

R&D
kimmo -> Purple
dirk -> Red
JollaHQ -> 2x Alumide


which adds up to 11, which means some people that showed interest previously have yet to send me their info. Rauha? MartinK?

ced117
2014-09-06, 23:11
Do you still take orders ?

dirkvl
2014-09-07, 06:32
Do you still take orders ?

Y

please contact me about shipping and payment (e.g. address and paypal mail)? also, let me know what colour you want!
info at funkyotherhalf.com

ced117
2014-09-07, 08:32
Ok dirkvl, will do that right away.
Thank you :)

dirkvl
2014-09-08, 10:08
First batch is here! Looking really cool and pcb fits like a glove!

https://dl.dropbox.com/s/4nfkbw371c4g4km/2014-09-08%2013.03.10.jpg
https://dl.dropbox.com/s/7zirlsfxl9cnnit/2014-09-08%2013.04.23.jpg
https://dl.dropbox.com/s/mmm0tut6iln3h0q/2014-09-08%2013.04.33.jpg

will have to wait for some extra capacitors and resistors, but these will all be sent this week!

cartron
2014-09-08, 14:24
Nice!
Can't wait to receive mine!
How about the script part? Is that Kimmo taking care of that?

kimmoli
2014-09-08, 14:55
How about the script part? Is that Kimmo taking care of that?

I'm taking care of it, as soon as i get my R&D part to tinker with.
Basics are done, so it should take only couple of nights + 1 to package everything in a shiny RPM.

cartron
2014-09-08, 15:08
I'm taking care of it, as soon as i get my R&D part to tinker with.
Basics are done, so it should take only couple of nights + 1 to package everything in a shiny RPM.

Awesome, thanks for the update Kimmo!

Kabouik
2014-09-08, 19:33
Mine is on all three pics. http://forum-images.hardware.fr/images/perso/flagadadim.gif

(And it's more pink than it seemed on Shapeways preview. :O)

dirkvl
2014-09-08, 19:46
Mine is on all three pics. http://forum-images.hardware.fr/images/perso/flagadadim.gif

(And it'smore pink than it seemed on Shapeways preview. :O)

you wont believe it, but it is even moar pink in real life. alumide was a cool surprise, but the pink is also very impressive!

d0n_Egg1
2014-09-08, 19:50
Mine is on all three pics. http://forum-images.hardware.fr/images/perso/flagadadim.gif

(And it'smore pink than it seemed on Shapeways preview. :O)

i like my red one :D
is a good contrast to my blue TOHOLED from kimmo :p

Kabouik
2014-09-08, 20:19
you wont believe it, but it is even moar pink in real life. alumide was a cool surprise, but the pink is also very impressive!

Actually I really like the pink hue on the second pic, but the third one makes me think about her:

http://reho.st/http://www.zenzoneforum.com/attachment.php?attachmentid=25639&d=1389993008

I prefer the hue of the second pic! :Ð

dirkvl
2014-09-09, 18:15
PCB file and BOM (https://www.dropbox.com/sh/d6kf99ubpzrbcaj/AABJuJH0aWu6LH9_Hom0GDSqa?dl=0)

Casing:
https://www.shapeways.com/designer/vanleersumprototyping
DipTOH_1.0.1

PCB: dip.brd

Electronics:
MCP23009-E/MG-ND
CAT24C02VP2IGT3A0SCT-ND
AT42QT1011-MAHCT-ND
MCP1703-SOT23
1mF 603 Capacitor x2
10pF 603 Capacitor
10k 603 Resistor
4K7 603 Resistor

MartinK
2014-09-09, 20:25
paid:
d0n_Egg1 -> Red
MemphisX -> White
Kabouik -> Pink
Koiruus -> Black
cartron -> Purple
asys3 -> Black
haliava -> Alumide

R&D
kimmo -> Purple
dirk -> Red
JollaHQ -> 2x Alumide


which adds up to 11, which means some people that showed interest previously have yet to send me their info. Rauha? MartinK?
Oops! Looks like I overslept a bit! :-P I guess it is too late now ?

Kabouik
2014-09-15, 09:52
Got mine this morning, can't wait to have the software side to test it!

The very flashy pink color is kind of difficult to deal with when there are people around (a darker pink would have been cool too), but to be honest I think I like it. :)

kimmoli
2014-09-15, 10:03
The very flashy pink color is kind of difficult to deal with when there are people around...

Your first steps of naturism...

I'm waiting for my still, so no SW yet :p

Kabouik
2014-09-15, 10:08
:>

Hope you'll get yours soon, I just put it on instead of the toholed and I'm now away till thursday with only this OH! :]

nokiabot
2014-09-15, 12:58
The coolest oh so far pink one is just :eek: and if insted of 1234567 they were just thick dots i think it would look a lot more cooler :D
Anyway awsome job !

Kabouik
2014-09-15, 13:50
Pink one is just what? :O Careful with what you're gonna say!

nokiabot
2014-09-15, 14:11
Pink one is just what? :O Careful with what you're gonna say!
i controlled myself a lot :D
Really its just :eek:

kimmoli
2014-09-15, 14:15
Hope you'll get yours soon,

urf, i have to go to do some welding/plasmacutting, so hope diptoh waits me at home when i get there.

dirkvl
2014-09-15, 17:05
i have to go to do some welding/plasmacutting, so hope diptoh waits me at home when i get there.

what a life!

have some diptohs ready to go at home, but the eeproms need to be programmed before i can send them.

the ones that are sent already are not programmed -my bad- so there will be probably be some instruction here also about how to do that. i guess step 1 will be: download i2ctool! (so you can do that already)

kimmoli
2014-09-15, 18:58
DIPTOH EEPROM Programming instructions:

Read through once before doing.

http://talk.maemo.org/images/icons/icon4.gifWarning : Don't do anything else in i2ctool, you may break your device.


1. Install i2ctool from jolla store
2. Attach diptoh to your phone
3. Open terminal
4. Start i2ctool as root devel-su harbour-i2ctool
5. Click enable Vdd button, power indicator should show now ON
6. Click TOH EEPROM button
7. View with lots of FFFF should appear. If not, contact me at freenode (kimmoli) or PM here.
8a. Click on each field to enter following values.

https://lh6.googleusercontent.com/-weYOkKJ0dQg/VBcz9HgCsyI/AAAAAAAAHpQ/6UFBdp8jTn0/w455-h809-no/20140915214301.jpg

8b. Double check values
9. Click Write button
10. Swipe back to main menu
11. Click again TOH EEPROM button, the values should be there. If you got FFFF contact me.
12. Swipe back to main menu
13. Click disable Vdd button
14. Close i2ctool

That is all for now.

kimmoli
2014-09-15, 20:44
progress...

syys 15 23:42:26 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000000
syys 15 23:42:27 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000001
syys 15 23:42:29 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000011
syys 15 23:42:29 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000111
syys 15 23:42:30 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 001111
syys 15 23:42:30 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 011111
syys 15 23:42:31 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 111111
syys 15 23:42:32 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 011111
syys 15 23:42:32 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000111
syys 15 23:42:33 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000110
syys 15 23:42:33 Jolla harbour-diptoh-daemon[19928]: Dips toggled: 000100

kimmoli
2014-09-15, 21:19
First version 0.1-1 of diptoh-daemon is here:

(Detach and attach diptoh once before installing)

RPM for install: Note http://talk.maemo.org/images/icons/icon2.gif Update available. See this post http://talk.maemo.org/showpost.php?p=1440568&postcount=108

pkcon install-local harbour-diptoh-daemon-0.1-1.armv7hl.rpm -y

Installer starts service automatically if you did manage to write EEPROM contents and DIPTOH is attached while installing.

Sourcecode for daemon is here: https://github.com/kimmoli/diptoh-daemon

If something fails: systemctl stop harbour-diptoh-daemon or just rip the diptoh off.

If you want to see what it says, e.g. journalctl -f | grep diptoh

Script files are now in /home/nemo/diptoh/

Currently every script just append $0 to /home/nemo/diplog
you can tail -f /home/nemo/diplog to see is the scripts run.

(dirkvl << I have some mechanical issues, and interrupt seems to generate even when not toggling dips, if i apply pressure to next to flash, they appear only when toggling dipswitch)

Kabouik
2014-09-15, 22:16
Thanks Kimmo! I had to start the service manually even though I did write to the EEPROM successfully and installed the rpm with the diptoh attached, otherwise no diplog was generated when switching the dips.

kimmoli
2014-09-15, 22:18
You might need to detach/attach diptoh once after writing eeprom

kimmoli
2014-09-16, 05:20
Examples:

Notes:

Scripts are run as root.
If you need to run them as normal user, use su - nemo -c "yourcommandhere"
If you make a script like rm -rf / don't blame me.


Dipswitch 1 controls bluetooth:

dip1on.sh
dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:true

dip1off.sh
dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:false

Dipswitch 2 controls Flightmode:

dip2on.sh
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:0 uint32:1

dip2off.sh
dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:1 uint32:1

Dipswitch 3 controls display always active:
Note: For this to work you'll need mce-tools installed: pkcon install mce-tools

dip3on.sh
mcetool --set-demo-mode=on

dip3off.sh
mcetool --set-demo-mode=off

Dipswitch 4 controls silent profile:

dip4on.sh
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"

dip4off.sh
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"general"

Dipswitch 5 toggles flashlight on/off: Thanks Coderus (https://twitter.com/iCODeRUS/status/513215697577840640)
http://talk.maemo.org/images/icons/icon4.gif - Toggling this switch on most probably makes you blind momentarily

dip5on.sh
su - nemo -c "echo 1 > /sys/kernel/debug/flash_adp1650/mode"

dip5off.sh
su - nemo -c "echo 0 > /sys/kernel/debug/flash_adp1650/mode"

Dipswitch 6 toggles Android / Aliendalvik on/off: Thanks MemphisX (http://talk.maemo.org/showpost.php?p=1439779&postcount=85)

dip6on.sh
systemctl start aliendalvik.service

dip6off.sh
systemctl stop aliendalvik.service


Dipswitch X plays a wav file when toggled on:
(also example how to run command as nemo)

dipXon.sh
su - nemo -c "/usr/bin/gst-launch-0.10 filesrc location=/home/nemo/Music/crazysoundeffect.wav ! wavparse ! audioconvert ! alsasink"

dirkvl
2014-09-16, 16:56
initially got some spares of every part, but all went well! so i can make another 6!

the first 6 to mail me (info at funkyotherhalf dotcom) with:
-address
-paypal mail
-preferred colour
will get one :)

delivery time dependent on shapeways (2-3 weeks or so)


-Klas -> alumide
-
-
-
-
-

Kabouik
2014-09-16, 22:03
Examples:

Thanks! The demo-mode is especially useful! I think those functions that are not easily accessible through Control Center (Patchmanager) *or* whose status (on or off) is not easily noticeable with an icon on the homescreen are ideal candidates for dip switches. If you have any other ideas of functions like that, don't keep yourself from posting scripts. :]

Bluetooth is very useful too of course, but it's in the Control center and its status is indicated with an icon, so it won't be my priority on a dip switch if I find 6 other useful functions (yet I will still configure bluetooth on one switch for now, I still find it convenient!).

____

Do we need to start the scripts with #!/bin/bash? Nothing seems to happen for me with demo-mode and Bluetooth, though I did have confirmation the switches were working with the simple echo functions in default scripts. I restarted the Jolla and the service just in case.

Koiruus
2014-09-17, 21:26
Umm, seems like something is not working. I made the i2c tinkering stuff succesfully and installed the rpm and the daemon is running.

But, the dips seem unresponsive. tail -f /home/nemo/diplog just gives me:

/home/nemo/diptoh/dip4on.sh
/home/nemo/diptoh/dip5off.sh

No matter what switches I dip. And journalctl -f | grep diptoh doesn't give me any print. I tried reattaching the oh but without any success.

kimmoli
2014-09-17, 21:31
journalctl as root.

Something has happened atleast, maybe.
Today i did use diptoh whole day without issues.

The gpio-expander is tricky, as it looses its config if it looses power.

I had to add some paper (2 layers of 80g) under the pcb (between 3dprint and pcb) for reliable contact. (<< dirkvl FYI)

If fails, just lift the toh few mm from the bottom left corner, to make the microswitch toggle.

dirkvl
2014-09-18, 13:43
will adjust design

Koiruus
2014-09-18, 17:21
journalctl as root.

Something has happened atleast, maybe.
Today i did use diptoh whole day without issues.

The gpio-expander is tricky, as it looses its config if it looses power.

I had to add some paper (2 layers of 80g) under the pcb (between 3dprint and pcb) for reliable contact. (<< dirkvl FYI)

If fails, just lift the toh few mm from the bottom left corner, to make the microswitch toggle.

Yep, something happens, but looks like it is not fully working. I did journalctl as root. But today I packed my Jolla and sent it to maintenance (accidental rebooting issues again), so I will try again when I get my phone back.

MemphisX
2014-09-20, 02:35
I've received mine a few days ago but it was quite a busy week so I didn't have enough time to play with it. First impressions: toh is great, the whole finish seems really professional (thanks so much dirk) and kimmoli's work on the software side is just genious (just in the thought that with the press of a dip switch I can run my custom bash scripts...)

I had a few problems with the stability of it and it seems that somehow occasionally the pins lose contact with the board (or something else is happening) and so I have to take off toh and put it back again. After removing the board from toh and putting some stickers between (following the advice of paper suggested above by kimmoli) the issue seems to be appearing less frequently. I have noticed though that sometimes after turning on the first dip it works but any other change won't until I refit toh.

From the example scripts provided by kimmoli those for display do not work simply because there is no mcetool in my jolla (fixed by installing it with pkcon: "pkcon install mce-tools") instead I added a simple script for enabling/unmasking disabling/masking aliendalvik which is extremely handy:

For Masking/disabling:
systemctl stop aliendalvik.service
systemctl mask aliendalvik.service

and for unmasking/enabling:
systemctl unmask aliendalvik.service
systemctl start aliendalvik.service

of course if you don't want to completely prevent aliendalvik from starting you can remove the mask/unmask commands.

Now I wish I knew of a way for enabling/disabling the led flashlight from the command line....

Question: Do we need to keep i2ctool installed after we finish the initial process of setting up the diptoh?

kimmoli
2014-09-20, 06:19
Now I wish I knew of a way for enabling/disabling the led flashlight from the command line....

Updated original list with flashlight sample: http://talk.maemo.org/showthread.php?p=1439380#post1439380

Also included aliendalvik sample (w/o masking) there. thanks.

Question: Do we need to keep i2ctool installed after we finish the initial process of setting up the diptoh?
No, it is not needed after programming eeprom.

cartron
2014-09-20, 19:16
excellent, thanks for the examples Kimmo.
I will look and try to make a script to enable/disable wifi - will post it here if successfull.

cartron
2014-09-20, 19:24
excellent, thanks for the examples Kimmo.
I will look and try to make a script to enable/disable wifi - will post it here if successfull.

that was easy, looking at /etc/connmain/main.conf gave a hint:
PreferredTechnologies = bluetooth,wifi,cellular

code for on:
dbus-send --system --print-reply --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:"Powered" variant:boolean:true

code for off:
dbus-send --system --print-reply --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:"Powered" variant:boolean:false

cartron
2014-09-20, 21:19
Now what I'm looking for is a way to have a switch which says:

"On => switch radio to 4G"
"Off => switch radio to 2G"

That way I can have 2G when not using the screen, and when using the screen, I manually switch to 3G or 4G.

kimmoli
2014-09-20, 21:30
dbus-send --system --print-reply --dest=org.ofono /ril_0 org.ofono.RadioSettings.SetProperty string:"TechnologyPreference" variant:string:"umts"


"any" for 4G
"umts" for 3G
"gsm" for 2G

cartron
2014-09-20, 21:31
dbus-send --system --print-reply --dest=org.ofono /ril_0 org.ofono.RadioSettings.SetProperty string:"TechnologyPreference" variant:string:"umts"


"any" for 4G
"umts" for 3G
"gsm" for 2G

Awesome Kimmo!
Thanks!!!

Kabouik
2014-09-21, 01:53
The switches still seem not to work here, though the scripts do work as intented if I manually run them with sh dipXon.sh as root in the terminal.

journalctl -f | grep diptoh finds no journal, or shows nothing (no error either) if run as root. And diplog shows nothing new (but there are some lines originating from my first few trials when the script were still default).

How can I check that the service is running/not conflicting with any other OH service?

kimmoli
2014-09-21, 06:36
That sounds strange;

...How can I check that the service is running/not conflicting with any other OH service?

You can check service with systemctl status harbour-diptoh-daemon

To check what is running, ps -A | grep toh When diptoh is not attached, you should see this:
95 ? 00:00:00 irq/331-toh-eve
786 ? 00:00:03 tohd


If you have journalctl -f | grep toh running while attaching diptoh, what you see?

And you could try to add 2-3 layers of paper between the PCB and 3D print.
Just small ~10mm pieces to position where contacts are.

Or you can try to manually start the diptoh
systemctl start harbour-diptoh-daemon (open another ssh session to do this, or New Window from fingerterm) and keep that journal running on the other.)

Hope this helps.

Kabouik
2014-09-21, 18:28
Thanks Kimmo.

Then, the service is running correctly. I had toholed running though, so I stopped it, disabled it, and I restarted diptoh but still no fortune when trying the switches again.

I already added two layers of papers between the PCB and the OH 3D print yesterday. :[

Here's what I get when attaching diptoh: http://hastebin.com/zuwapoqeyu.avrasm

Apparently there's something wrong with the EEPROM. That's weird because I did check that I entered the correct values when I used i2ctool, and after the first trials, the scripts where correctly echoing to diplog.

kimmoli
2014-09-21, 18:43
Did you have prototype toholed? (my bad memory)
The new versions should not be running, only when it is actually attached, just like the diptoh

öh. Copied it here to easier commenting:

Sep 21 20:27:16 Jolla systemd[1]: Stopping Diptoh Other Half...
^ this is caused by opening the TOH microswitch (removing TOH), then it kills the daemon.
Sep 21 20:27:16 Jolla harbour-diptoh-daemon[791]: Received signal SIGTERM
Sep 21 20:27:16 Jolla harbour-diptoh-daemon[791]: vdd set to off
Sep 21 20:27:16 Jolla harbour-diptoh-daemon[791]: diptoh exiting, bye
Sep 21 20:27:16 Jolla systemd[1]: Stopped Diptoh Other Half.
^ daemon is now shutdown, but there is prints from daemon so it has been started at some point.
Sep 21 20:27:19 Jolla kernel: toh-core toh-core.0: No valid eeprom present
^ This occurs when TOH microswitch is pressed again, but there is no contact between toh pcb and phone.

If you try this when attaching toh: start from top, and while applying pressure to the area where PCB is (making sure there is contact) and bending the print a little (2-3mm) to make the microswitch-corner to be last to snap in.

(I have discussed with Jolla to add some retries/delay to the eeprom reading procedure)

Kabouik
2014-09-21, 18:54
Yep I had prototype toholed, have I missed some new versions of the software?

Here's what happens when attaching the toh as you said:

# Here I just removed diptoh:
[root@Jolla nemo]# journalctl -f | grep toh
Sep 21 20:51:28 Jolla systemd[1]: Stopped Diptoh Other Half.

# And reattached it as you said:
Sep 21 20:52:13 Jolla kernel: platform toh-core.0: parent platform should not be sleeping
Sep 21 20:52:13 Jolla kernel: wakeup wake lock: tohd
Sep 21 20:52:13 Jolla kernel: active wake lock tohd
Sep 21 20:52:13 Jolla systemd[1]: Starting Diptoh Other Half...
Sep 21 20:52:13 Jolla systemd[1]: Started Diptoh Other Half.
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: diptoh starting, yay. My version is 0.1
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: vdd set to on
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: mcp23009 initialized
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Worker started
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Write failed.
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Dips toggled: 111111
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Nothing actually changed
Sep 21 20:52:16 Jolla tohd[783]: timeout; terminating discovery

Switches seem to work now. :eek:
...
Well they stopped working 2 minutes later. :(

kimmoli
2014-09-21, 19:01
Yep I had prototype toholed, have I missed some new versions of the software?
no, no updates for proto.sw

The journal you copied is ok.
That one "write error" is unknown, and i have it too.

Do you have all switches at position 1 (on) ?

And you dont see anything if toggling now?

Kabouik
2014-09-21, 19:03
Yep, all were at position 1. First trials have worked (demo-mode, bluetooth, wlan), and then switches have stopped working (even those I cited).

kimmoli
2014-09-21, 19:08
öö, so it works few times now? (or was this the first time you tried it and it worked?)

set all to OFF and reattach, does it show like this then
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Dips toggled: 000000
Sep 21 20:52:13 Jolla harbour-diptoh-daemon[27420]: Nothing actually changed

Kabouik
2014-09-22, 12:44
Yes Kimmo, I edited the previous message (20:54) when I realized switches were working with the custom scripts! But it stopped working a few minutes later. I removed the diptoh and replaced it again the way you advised, and it works again. I guess it stopped working yesterday because of a bad contact, or because perhaps I moved two switches at the same time inadvertently? Would that be an issue if that happens? Considering that I have very short nails and that the switches are tiny, this can happen quite often. :)

Anyway, thanks for your very valuable help Kimmo!

kimmoli
2014-09-22, 13:19
... or because perhaps I moved two switches at the same time inadvertently? Would that be an issue if that happens? Considering that I have very short nails and that the switches are tiny, this can happen quite often. :)
I haven't actually made such testing, but i assume no. It processes dips that changed in same interrupt in a for-loop, and processes are started as detached.
https://github.com/kimmoli/diptoh-daemon/blob/master/src/dips.cpp#L172

I think there is still contact issues. I had to reset it twice (just liftng that one corner few mm), specially if i have phone in my pocket.

Anyway, thanks for your very valuable help Kimmo!

You make my ancestors proud...

Kabouik
2014-09-22, 16:11
You're right, I just checked after having carried the Jolla in my jean's pocket today, and the switches had stopped working again. Lifting up the bottom corner solved it.

I noticed that the switches had moved from "off" to "on" or the opposite while in my pocket, though I did not pick the Jolla from my pocket very often today (it was just sitting there in my pocket). That could be an issue to solve for future revisions of the diptoh (but future versions would need larger buttons or larger space between them anyway, to be more useable for people like me who have short nails). These pockets can be a bit tight though, that should be OK in almost every other pants I have.

Speaking of that, I'd appreciate any built-in system to help removing OHs for people who have no nails. I have to find a tool and slightly scratch my Jolla every time I must remove an OH (and I really have to, there is no way I can remove a custom OH with no tool; don't laugh at me). A small notch in future 3D prints, or small lever, or anything, I don't know.

I'm glad I made your ancestors proud! Now finish and ship some toheinks and you'll be the greatest offspring ever. :]

asys3
2014-09-22, 18:36
First of all:
Thanks kimmoli and dirk for both hard- and software developing for the DIPTOH - really great!!!!

I'm doing some experiments with different calls at the moment and came to one point:


Is it possible to check the position of a switch?

If I don't miss anything we do it the other way round: using a switch calls a script.

Can we also read out the positions of all switches?

asys3

kimmoli
2014-09-22, 18:45
If I don't miss anything we do it the other way round: using a switch calls a script.
Yes, toggling the switch causes interrupt, which tells daemon to read switch states from gpio expander over i2c.
Daemon them compares read states to previous states, and executes a specified script of state which really changed.


Is it possible to check the position of a switch?
...
Can we also read out the positions of all switches?
Not at the moment, but I can add e.g. dbus interface to check the current state? or write them to a file e.g. /tmp/dipswitchstate when ever they change.

To prevent the whole diptoh to die after single connection break, i think i will add timer to periodically check and re-init gpio expander if needed.

haliava
2014-09-25, 09:09
Eh, and what's about the button? Where is the area, how should it be pressed and whether there'll be capability to run a script on this interrupt as well?

kimmoli
2014-09-25, 09:28
Eh, and what's about the button? Where is the area, how should it be pressed and whether there'll be capability to run a script on this interrupt as well?

It is located below DIP-switch, you can see the void in bottom copper of PCB, about there.

Not yet implemented in the daemon though. Update coming, ETA 12 hours

dirkvl
2014-09-25, 15:49
tomorrow the last shells arrive, then the last ones go on the mail!

kimmoli
2014-09-25, 20:31
OBSOLETE

http://talk.maemo.org/images/icons/icon2.gif Update 0.4-1

Download RPM here: https://app.younited.com/?shareObject=4735f7c0-2f99-9025-0359-7726d2d559f0

Update will not overwrite your dip*.sh scripts (but make a back e.g. tar czvf diptoh.tgz /home/nemo/diptoh/ just to be sure)


Adds two scripts,. buttondown.sh and buttonup.sh these will be run when the secret button is pressed and released.
Checks every 30 sec has diptoh been disconnected. In case this is detected, chip will be reinitialized.
It also improves the interrupt and gpio handling - there was few issues in case of switch-bouncing etc.

haliava
2014-09-26, 12:28
http://talk.maemo.org/images/icons/icon2.gif Update 0.4-1


Interesting, after installing this and rebooting the phone - there's something wrong with it. Gui can't connect - frequent green flashes with screen blank after the initial boot sequence. Guess will factory reset from recovery and try again - as I don't think I have patience/time to troubleshoot in shell not really understanding what could go wrong.
Or does someone have a better idea?

kimmoli
2014-09-26, 12:36
Interesting, after installing this and rebooting the phone - there's something wrong with it. Gui can't connect - frequent green flashes with screen blank after the initial boot sequence. Guess will factory reset from recovery and try again - as I don't think I have patience/time to troubleshoot in shell not really understanding what could go wrong.
Or does someone have a better idea?

argh. that doesn't sound nice at all. I make quick reboot and test it myself. iirc i did reboot-test it atleast once.

This shouldn't happen if diptoh is not attached to phone, as it is not started in that case.

-------

:mad: Ok, seems that during reboot, it gives sporadic interrupt, at first reboot it did execute dip1on and dip1off, and on 2nd boot only dip1on.

I raise an issue to me about this, and try to fix it asap (ETA 5 hours)

haliava
2014-09-26, 12:52
Well, for me it doesn't boot with whatever OH (or not any) is attached.

kimmoli
2014-09-26, 15:07
http://talk.maemo.org/images/icons/icon2.gif Update 0.5-1

RPM here https://app.younited.com/?shareObject=3c327eb0-5f57-31fa-daa3-3f69e7ababe1

Changes:

Clear interrupts before enabling gpio-int. (Prevents scripts from running at start/reboot.)

haliava
2014-09-26, 16:26
http://talk.maemo.org/images/icons/icon2.gif Update 0.5-1



Anything I could do from recovery shell to restore device to bootable state - or is the factory reset my only option? :)

kimmoli
2014-09-26, 16:57
Anything I could do from recovery shell to restore device to bootable state - or is the factory reset my only option? :)

I was wondering what kind of scripts you had there? I did notice some strange behaviour once during development, as i did trigger all 6 scripts at once - after that mobiledata was completely disabled until reboot. (i have my example-scripts 1..4, and soundplaying-one)

but... it is really hard to say what could gone wrong there.. the daemon itself does not write anything anywhere, except to
/sys/class/gpio/export
/sys/class/gpio/gpio67/...
/sys/devices/platform/reg-userspace-consumer.0/state

That updated version uses libiphb (compiled within) but i use exactly same stuff in toholed.

I will seek advisory from irc

kimmoli
2014-09-26, 17:13
https://together.jolla.com/question/22079/howto-all-pc-users-recover-or-reset-a-device-that-is-stuck-in-boot-loop/#post-id-22127

http://talk.maemo.org/showthread.php?p=1428999#post1428999

haliava
2014-10-01, 15:09
Well, only factory reset helped. Now after installing the latest version phone behaves fine - though it doesn't look like daemon is working. Scripts do not seem to activate, and there are also no records in journal. My EEPROM is supposed to be programmed - as oh was shipped out after the related post.
So kimmoli, probably will need to have a lunch with you for troubleshooting.

kimmoli
2014-10-01, 15:23
So kimmoli, probably will need to have a lunch with you for troubleshooting.

Ok for me :cool:

evk
2014-10-09, 10:02
Got mine. I thought that it'd be mostly a novelty due to dip beeing slightly fiddly, but it's very usable. Now we only need more apps with dbus-interfaces.

Only problem is that can't use it toghether with the lastu case.

MemphisX
2014-10-26, 00:28
Is it only me or after the latest Jolla update (1.1.0.38) the DIP_TOH stopped working?

Kabouik
2014-10-27, 17:13
It still works for me. However, it stops working every few days with no apparent reason, I have to remove it and reinstall it to make it work again, which is terrible for me as I my nails are not long enough to remove an OH. :)

More importantly, I'm not sure it is related to the diptoh but let's throw it just in case someone experienced the same thing: I lose network (phone and data) several times a day approximately since I use diptoh. Sailfish utilities to restart network does not help, nor does my diptoh script to switch from 3/4G to 2G. Not more success with the flight mode toggle. I lose network in areas where there is good coverage, be it 2G, 3G or 4G, and in several distant locations (I moved like 800 km last week and the problem occurred in all areas). There is not necessarily a notification for the error, just the phone network gauge displayed as empty and no data connection indicator. Only rebooting helps solving the issue (instantly). Is it possible that it is related to the diptoh? I would happily test that by using toholed for a few weeks but it doesn't offer the update when I plug it and I have no time right now to investigate why. And there is no way I will put a regular OH on my Jolla. :)

kimmoli
2014-10-27, 20:01
Kabouik, lets check further via email. both cases.

Koiruus
2014-11-13, 01:03
Is there any change of making a dip script to control vibration mode? Thanks in advance.