06-16-2013, 02:59 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jun 2013
Device: Kindle 4
|
weather mod; missing cron on Kindle 4
Hi. I'm trying to get a weather mod going on my Kindle 4, as seen here:
http://www.shatteredhaven.com/2012/1...r-display.html I did the jailbreak, installed kite, and put the two weather scripts on it (display-weather.sh & init-weather.sh). When I run init-weather, the Kindle successfully pulls the weather image from a little server program running on my Win7 machine. So far so good. Now I'm stuck on the last step of getting the script to autorun every 5 mins or so. The Kindle doesn't seem to have cron. I SSH into the Kindle while it's hooked up to the computer and in diagnostic mode (is this the correct way of doing it?). But /etc/crontab/root wasn't there, and trying to restart cron with "/etc/init.d/cron restart" says that cron isn't found. Just to note.. I briefly installed/used Duokan and librerator, before restoring to factory defaults and then doing this weather mod. Could that have caused cron to go missing? Any way to get cron back? I'm very noobish with Linux. Last edited by knick; 06-21-2013 at 06:48 PM. |
06-17-2013, 02:45 AM | #2 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Maybe in newer firmware, they've dropped cron? I don't think that Duokan would remove cron (and certainly not Librerator), though I'm not 100% sure of that. But there wouldn't be a reason to do so.
As it doesn't really depend on the exact time when it should run and probably it's okay to do it roughly every 5 Minutes, I think you can just put it in a "while sleep 300; do <updatecommand>; done" loop. |
Advert | |
|
06-17-2013, 11:19 AM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jun 2013
Device: Kindle 4
|
Here's the original display-weather.sh
Code:
#!/bin/sh cd "$(dirname "$0")" rm weather-script-output.png eips -c eips -c if wget http://server/path/to/weather-script-output.png; then eips -g weather-script-output.png else eips -g weather-image-error.png fi If it helps any, I think the Kindle is a Fall 2011 model. It apparently had SSH already installed, but I also installed USBNetworking while following the weather mod instructions (maybe that somehow caused cron to go missing?). The firmware is v4.1.1 |
06-17-2013, 11:59 AM | #4 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Perhaps it is only missing in the "diags" system, in the main system:
Code:
[root@kindle root]# ps aux | grep cron root 677 0.0 0.2 2432 516 pts/0 SN+ 11:08 0:00 grep cron root 17652 0.0 0.2 2428 544 ? Ss Jun07 0:02 /usr/sbin/crond -c /etc/crontab/ Code:
[root@kindle root]# ls -l /usr/sbin/cron* lrwxrwxrwx 1 root root 17 Sep 23 2011 /usr/sbin/crond -> ../../bin/busybox [root@kindle root]# ls -l /etc/crontab/ -rw-r--r-- 1 root root 228 Sep 23 2011 root [root@kindle root]# cat /etc/crontab/root */15 * * * * /usr/sbin/checkpmond */15 * * * * /usr/sbin/tinyrot */60 * * * * /usr/sbin/loginfo tmpfs */60 * * * * /usr/sbin/loginfo localVars */60 * * * * /usr/sbin/loginfo memusedump */15 * * * * /usr/sbin/loginfo powerdcheck So if you can't find cron in the 'main' system partition (the K4 is a dual-boot machine), then you might want to KUBRICK it back to factory stock. |
06-17-2013, 12:32 PM | #5 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jun 2013
Device: Kindle 4
|
Ah. I guess I've only been logging into the diags system. I'm not entirely sure how to SSH into the main system. Something with USBNetworking and searching for ";Debug" perhaps? Maybe someone can lead me in the right direction?
Anyway, when I noticed /etc/crontab was missing, I created it, and then created /etc/crontab/root with the line I wanted. The following at least confirms that was successful. But again, I guess I only did that in the diags system, so it didn't help me any. Code:
login as: root root@192.168.15.244's password: ################################################# # N O T I C E * N O T I C E * N O T I C E # ################################################# Rootfs is mounted read-only. Invoke mntroot rw to switch back to a writable rootfs. ################################################# [root@[192_168_15_244] root]# cat /etc/crontab/root */5 * * * * /mnt/us/weather/display-weather.sh [root@[192_168_15_244] root]# |
Advert | |
|
06-17-2013, 12:49 PM | #6 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Kubrick it back to a known state. Kubrick will take about 10 minutes to replace the firmware with factory stock (plus usbnetworking, jailbreak, etc). (It will probably take longer to download and burn the CD/DVD than to re-flash the K4) Install the KUAL launcher. Install the helper button(s) that includes USBnetworking enable/disable. BIG NOTE: have the USB cable disconnected when changing into and outof USB networking mode. Once you have enabled USBnetworking mode, attached the cable, and killed off any host PC automation that event triggered . . . . Putting up the connection (on a *nix machine) looks like this: Code:
sudo ip address add 192.168.2.1 peer 192.168.2.2 dev usb0 sudo ip link set up dev usb0 telnet 192.168.2.2 And yes, the "main" system image expects to use the IP addresses shown above, not the ones you have been using for the "diags" system. |
|
06-17-2013, 01:10 PM | #7 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jun 2013
Device: Kindle 4
|
I just wanted to say thanks for the help so far. But it seems that using Kubrick may be a bit premature now, because I'm now able to get into the main system!
Code:
login as: root Welcome to Kindle! root@192.168.2.2's password: ################################################# # N O T I C E * N O T I C E * N O T I C E # ################################################# Rootfs is mounted read-only. Invoke mntroot rw to switch back to a writable rootfs. ################################################# [root@kindle root]# cat /etc/crontab/root */15 * * * * /usr/sbin/checkpmond */15 * * * * /usr/sbin/tinyrot */60 * * * * /usr/sbin/loginfo tmpfs */60 * * * * /usr/sbin/loginfo localVars */60 * * * * /usr/sbin/loginfo memusedump */15 * * * * /usr/sbin/loginfo powerdcheck [root@kindle root]# Anyway, all I did was reinstall USBNetworking, and then carefully reread the instructions at http://www.shatteredhaven.com/2012/1...work-hack.html. Specifically, the part where it says to type ";debugOn" and then "~usbNetwork" and then I got the lightning bolt/charging indicator as expected. Then it was just a matter of changing the network adaptor IP to 192.168.2.1, and using Putty to log into 192.168.2.2. I'll be sure to report back if/when I get the weather to finally auto-refresh. |
06-17-2013, 01:49 PM | #8 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
A nicely written post that you found.
Perhaps it should be added to our index pages (anyone can do that). I prefer using a point-to-point link on the specific device but I don't know how to describe doing that under Windows. (My LAN has other devices using that pair of addresses.) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle Weather Display WITHOUT server | scolby33 | Kindle Developer's Corner | 41 | 07-21-2014 08:30 AM |
Content Kindle Weather Station | kindlews | Amazon Kindle | 38 | 02-15-2012 09:25 AM |
Daily Weather Forecasts on Your Kindle? | Lulu | Amazon Kindle | 5 | 11-09-2011 04:56 AM |
Free (Kindle app) AccuWeather (Weather Forecasts on Kindle) | arcadata | Deals and Resources (No Self-Promotion or Affiliate Links) | 6 | 11-06-2011 02:39 PM |