Team-BHP > Technical Stuff > DIY - Do it yourself
Register New Topics New Posts Top Thanked Team-BHP FAQ


Reply
  Search this Thread
25,083 views
Old 9th November 2018, 16:09   #31
BHPian
 
shady8701's Avatar
 
Join Date: Aug 2017
Location: Bangalore
Posts: 37
Thanked: 86 Times
re: DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3

Quote:
Originally Posted by francis_vaz View Post
Thank you!

You can give it a try since all the codes that you will need are available here.
Do share if you are able to get it working.

Thanks Francis,

I'll try as soon as I have some spare time - as hard as that is to come by unfortunately.

Cheers,
Abhi
shady8701 is offline   (1) Thanks
Old 4th December 2018, 11:09   #32
BHPian
 
francis_vaz's Avatar
 
Join Date: Jun 2018
Location: Mumbai
Posts: 182
Thanked: 491 Times
re: DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3

#UPDATE#
So after some testing I found that there were a lot of shortcomings/problems in the DIY, some of them were very important and others were just general updates and enhancements. During this period I also stumbled upon a new app called Automate on the Play Store and it turned out to be much better in terms of reliability and overall functionality. The main advantage of this app was the flowcharts, which were not system/phone specific and were common to android devices in general.
So I have added all the flowcharts in a zip archive at the end of this post, you can extract the zip and just import all the flowcharts in the app and get them working right away, except for the charging codes and mobile numbers.

Below is the list of improvements and additional features.

1] Hardwire kit issue:
The kit arrived from AliExpress but as it turns out it was not actually rated to work at 5V and 2.5A and hence it was not able to charge the power bank.
So I switched to plan B which was a bit expensive but much reliable and safe. The plan was to make a cigarette lighter socket and add in a Regor 12V to 5V USB charger. The reason I opted for Regor was because it stopped charging the power bank once the power bank was full, so the power bank wasn't overcharged in case of a long journey.
Below is how the cigarette lighter socket and the Regor charger was installed along with a 2A fuse. Since I was using only one USB port of the Regor charger a 2A fuse was sufficient, if you intend to use both a 4A fuse is recommended.

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-img_20181124_122407.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-img_20181124_122421.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-img_20181124_122437.jpg

Link to the items:
Charger: https://www.amazon.in/gp/product/B01...?ie=UTF8&psc=1

Socket: https://www.amazon.in/gp/product/B01...?ie=UTF8&psc=1

2] Power Bank:
Next in line was the power bank; since a lot of fellow BHPian's suggested to avoid using a power bank given the fire hazard it could cause, I thought of some alternatives and the only option available was to directly connect the the phone to the USB charger and skip the power bank completely.
But after checking this setup a problem arised, that was offline charging in android. The problem was if the phone switched off due to low battery, the phone wouldn't boot after the charger was turned ON, instead it would enter offline charging mode and during this mode the phone would charge in switched off state and wouldn't boot without someone actually pressing and holding the power button. To solve this problem in other phones some fastboot commands are available but sadly none for the Sony phones.
The only phones that this could be done with fastboot codes or editing system files was in older Motorola, Samsung and Lenovo phones. For Sony phones you have to edit the kernel and make changes to the ramdisk and then you can skip the offline charging and have the phone boot directly.
I am adding a link below for those of you wish to check how it can be done.

https://appdictive.dk/blog/android/h...ge_on_android/

After this issue was sorted out the phone booted normally once the power was resumed after the car was turned ON.
I have still retained the power bank in my setup and will change it after I upgrade the Sony to a newer phone.

3] Location update:
One major problem with the Find my Device app was the location update frequency. I used to get an error on the app that the location is not updated even after refreshing the app many times. So after some tinkering I finally found that it was the google sync timing that caused the location to update.
So I added one more flow that would manually sync the location every five minutes and that solved the problem.

4] Issues with Automateit(older) app:
The problem with the older app was the limitations, such as keeping the device awake to ensure the messages are sent without any problems when using the shock sensor function.
With the new app this problem was solved completely and that also improved the battery life by a huge margin and now the phone lasts for an entire day without charging. This time will reduce if shock sensor is used. This also meant that the CPU awake app was no longer required.

5] Battery temperature:
Another problem was the Li-Ion battery in the phone. Even though in my case the phone is kept in a plastic box and completely away from any source of heat, I made a temperature monitor that would send a message if the battery temperature rised above 46 degrees. A Li-Ion battery usually heats upto 44 degrees under normal charging conditions. So I added a temperature monitor that would check the battery temperature every 10 min and if it rises above 46 degrees I'll get a text message on my phone alerting me.


Link to the app: https://play.google.com/store/apps/d...automate&hl=en

Below are the flows that I have created, extract the zip file and copy all files to your internal storgage/SD card and open the automate app and import them. There are other flows in the zip archive as well, the titles are self explanatory you can import and try them or edit and use them your way.
Since I had my mobile number and email ID in those flows I have edited them out with "0000" and "1111". Edit the flows and add your phone number in place of them, where "0000" will be the receivers number (the phone on which you intend to receive the updates from the DIY phone) and "1111" will be the number from which you expect the phone(DIY phone) to receive the commands. Keep this area("1111") blank if you wish to use multiple numbers to send commands. Also change Subscription ID to the SIM card that is currently in the phone.
The "code" area needs to be replaced with the terminal commands that disables and enables charging.

To disable charging:
Quote:
Code 1: "echo 0 > /sys/class/hw_power/charger/charge_data/enable_charger"

Code 2: "echo 1 > /sys/module/pm8921_charger/parameters/disabled"

Code 3: "echo 0 > /sys/class/power_supply/bq2589x_charger/enable_charging"

Code 4: "echo 1 > /sys/class/power_supply/battery/input_suspend"

Code 5: "echo 1 > /sys/class/power_supply/battery/store_mode"

Code 6: "echo 0 > /sys/devices/platform/battery/ChargerEnable"
To enable charging:
Quote:
Code 1: "echo 1 > /sys/class/hw_power/charger/charge_data/enable_charger"

Code 2: "echo 0 > /sys/module/pm8921_charger/parameters/disabled"

Code 3: "echo 1 > /sys/class/power_supply/bq2589x_charger/enable_charging"

Code 4: "echo 0 > /sys/class/power_supply/battery/input_suspend"

Code 5: "echo 0 > /sys/class/power_supply/battery/store_mode"

Code 6: "echo 1 > /sys/devices/platform/battery/ChargerEnable"
Below are some screenshots on how the flows are designed and the places where the editing needs to be done.
DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-screenshot_20181203222834.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-screenshot_20181203222841.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-screenshot_20181203223117.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-screenshot_20181203223347.jpg

DIY - Car Tracker, Activity Monitor & WiFi-hotspot using an Android phone - new update on page 3-screenshot_20181203223546.jpg

Attachement:
Flows.zip


The codes used for activating and deactivating the flows are given below, these codes are case sensitive.
  • ShockOFF.
  • ShockON.
  • HotspotON.
  • HotspotOFF.
  • Reboot.


I'll add more features and keep this thread updated as and when time permits.

PS: I have no affinity towards the products or the company mentioned above in any manner.
francis_vaz is offline   (3) Thanks
Reply

Most Viewed


Copyright ©2000 - 2024, Team-BHP.com
Proudly powered by E2E Networks