Firefly Open Source Community

Title: Sleeping mode - CarPC Project [Print This Page]

Author: firefan    Time: 3/5/2015 00:39
Title: Sleeping mode - CarPC Project

hi all,

I'm planing FireFly as headunit in mycar,

of-course, the OS is android,  my question is how is it possible to makes the FireFly sleeps (auto) when ignition off?


In phones there is an option (in Developer mode)  "Stay awake when charging" and 2 min after screen off the device became to deep sleep mode,  unfortunately, in FireFly i have the same option in developer mode but connecting\disconnecting power via OTG do nothing...


Any solution???   


Thanks


Author: zhansb    Time: 3/9/2015 11:54
Title: Re: Sleeping mode - CarPC Project

firefly no support battery  charge, so may be some diff.

you can modify relevant wakelock to achieve your goals.


Author: mbt28    Time: 3/11/2015 17:45
Hello,

It is better if you shut your device completely otherwise I can drain your battery. I suggest you to build a circuit with 555 TIMER then use some electronics to sense ignition over GPIOS.

Logic should be in this way:
1- When the ignition gets off, computer should show you a warning that it will shutdown in a defined time. If the computer doesnt shutdown in 7 minutes for example, 555 TIMER will cut the power completely.

2- When the ignition on 555 timer will be resetted so system will start to power again it will cause to start up of firefly.

OR

1- If you really trust the stability of your software and hardware you can just sense ignition through GPIOs. And everytime computer shuts itself down in defined time after ignition off mode.

NOTE: Please be careful with the ignition cable, don't run anything on it. It is just for sensing the car equipments you can easily burn it. I suggest you to use optocoupler.

Regards.
Author: firefan    Time: 3/12/2015 06:59
Hi,
First,  Thanks for your help,
i have a lot of experience in car audio,  the draw of Firefly in sleep mode is really low so i don't worry about it.
Since i have software developer i found tiny board (such as Arduino) for send sleeping key code when ignition off,
but my real problem is how to wake up the board via GPIO,   i don't have any knowledge in hardware.

I'm trying to figure out how to implement it,    i will appreciate any help,  just let me know which pin i have to connect on FireFly?
Which voltage i have to supply (1.8V, 3.3V, 5V, 12V)?  and for how long time?


Thanks!
Author: mbt28    Time: 3/12/2015 17:39
Hi,

Well, I heard some stories about battery drain but I have never faced this kind of issue. I also heard one guy that who let his ipod plugged in his car through Arduino, and the battery was dead after few days. Just to let you know however I am not really experienced as you in this field. Have you already measured how much power does firefly uses during sleep?

Actually, I think you don¡¯t need to use Arduino or microcontroller to send sleeping code. As you are software developer you can simply listen GPIOs with a small script when it sense ignition is of you can go to halt. When It comes to wake it up normal power button or GPIOs which are responsible from power off has to wake the board up. Unfortunately, I haven¡¯t got a board yet that¡¯s why I cannot check it out, and I couldn¡¯t find any doc on this website. Lastly, I think you don¡¯t have to supply a voltage just bring two pins together with the help of optocoupler, in this way you wont risk your ignition line and it will be isolated from your board to have more clear sound.

Regards
Author: firefan    Time: 3/12/2015 19:41
Hi,
There a lot of documents on firefly WIKI. http://wiki.t-firefly.com/index.php/Firefly-RK3288/en

Either-way,  i'm waiting for more info. (when you will get the board)

Thanks.

Author: mbt28    Time: 3/12/2015 20:09
Last edited by mbt28 In 3/12/2015 20:23 Editor

Hi,

Have you ever tried to use power button to waking it from halt?

Also if it appearent could you please check the circuit of power button where it goes.

Edit:


After confirming all the connections are OK, plug the power adapter into the socket to power up the board. The board will boot automatically at the first power on.

Select "Shutdown" in Android system, keeping the board's power. Then we can boot Firefly-RK3288 by two ways:

Long press power button for more than 3 seconds
Press "power" button on the infrared remote control
During booting, the blue LED will light up, and four cute penguins will be shown on display, which indicates the quad-core CPU.



Probably, it is programmed in firmware. I think easiest solution for you to make an parallel line to power button. You can do it simply solder 2 cables (do not drill it as it is a multilayer pcb). However you have to make a circuit to arrange timing, probably with 555 but it would be a very easy if you cannot I can help you. For now, I cannot find out a simplier solution.

Regards.

Author: firefan    Time: 3/12/2015 20:49
hi,
Thats the second reason i thought on small micro-Controller board (3$),
It should be using for send sleep command,  "press" power button and also send remote-out. (via Relay),
I thought via GPIO it should be the "Right way".  (very easy script)

in a case i will implement in this way, my question is which hardware (chips) are you recommend to using for "short" the power button.    (Relay, SSR Relay or optocoupler, if so, do you have any specific model?)

Thanks
Author: mbt28    Time: 3/12/2015 21:46
Hello,

If you use microcontroller like attiny something else I suggest you to use a optocoupler. You can definitely almost do everything that you wish to do in this way.

If you ask me I prefer to create a small logic circuit to provide push button alternative. Let me think about this circuit, it has to be easy but I couldn't find out a way now.

NOTE: Please don't use power switch directly, probably there is resistor inside this switch. First try to understand the specs then make parallel connection.

Regards.
Author: firefan    Time: 3/13/2015 01:26
hi,
Since i don't have any knowledge in electricity i will waiting that you will get the board.   :-)

Thanks a million!

Author: mbt28    Time: 3/13/2015 18:07
Hello,

I do not know which car are you working on but if you get a CAN tranceiver microchip you can combine it with regular microchip. Then you can control the board as you like. You can MCP series of microchips, for the programmable microchip you can have an attiny and install arduino software. You can burn the arduino bootloader simply by using usb to ttl card which is like 2usd in aliexpress.

These CAN transceivers they have on-board regulated voltage output. They wakes up immediately with the any can signal in the car, and provide regulated voltage. With that voltage you can easily drive your microchip and this microchip can manage the power.

It is going to be even cheaper, safer and simplier I think. Because in any case you should use a can receiver in your car pc.

Regards.
Author: firefan    Time: 3/15/2015 16:18
hi,
its VW GOLF 2004 (MK4),   there isn't CANBUS there,
Either-way, Thanks a lot for your efforts.
Author: mbt28    Time: 3/16/2015 17:01
I see, as far as I check on the internet you might have something similar can bus not bus but a network line which uses it.

Do you have illumination on your button light during the night and day?
Author: firefan    Time: 3/16/2015 22:08
yes i have.
Author: mbt28    Time: 3/17/2015 16:53
Hello,

This has to be working through a network, It is similar to odb 2 standard. If you want to build fully functional head unit you should be able to decode this line and inject bytes as well.
Author: mbt28    Time: 3/17/2015 19:06
Last edited by mbt28 In 3/17/2015 19:12 Editor

Hi,

Well also I discovered that I can read battery voltage over ibus. Maybe you can do the same over your network, in this case no need to shutdown the board until the battery voltage downs on a defined level.

Regards,
Mehmet
Author: firefan    Time: 3/18/2015 19:47
hi Mehmet,
OBD and IBus are complicated solutions (At least for me),  i found Voltage reader module (on IGN wire), very cheap and easy to use.

BTW, did you got your board already?
Author: semperfi1776    Time: 9/1/2015 06:25
mbt28 Posted at 3/12/2015 21:46
Hello,

If you use microcontroller like attiny something else I suggest you to use a optocoupler.  ...

Hi firefan,
I see that you are using the board as a head unit. I was wondering if you are using android 4.4 as the OS. if so are you supporting bluetooth A2DP sink and HFP?  if yes, did you have to manually enable A2DP sink and HFP on firefly's android image? thanks




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1