Author Topic: Htc Universal  (Read 698775 times)

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #75 on: April 19, 2008, 10:19:16 am »
Quote from: datathief
The function to decode an SMS doesn't handle anything more than 7-bit ASCII yet.
How hard is UTF-8 to implement? This is one thing pretty import for me due to using UTF-8 text a lot, but beyond my scope of contribution...

Quote
Quote
After making a call, touchtones are not possible. Thus when you dial into let's say a mailbox, or a bank automatized system, you cannot enter numbers or pounds etc.
True.  I can add a function to htcunid to do this, but I don't have any ideas for a UI.
I think at least in this stage a UI isn't necessary at all. One can just type on the hardware keyboard and if it'll sent DTMF tones it's fine.

Quote
Do you have apmd installed?  This works for me (see /etc/apm/event.d/htcuni-keyboard).
It was probably a problem of zdevil's rootfs and my modifying it. I'm currently trying with your simple rootfs.

Quote
Quote
Anyhow, an archiving option needs to be built into the SMS receiption. I.e. not only display the SMS received and number it came from, but also echo it >> to a default SMS archive. If you're not working on it, I'll come up with a temporary hack. The same goes for calls. There needs to be a call register. I'm just about to check the caller ID in htcunid-0.3, but again, a simple echo the number and time >> to a call-log file should do.
The default example script does this.  A better solution would involve /var/spool and use mailbox format.  Feel free to upload scripts to the wiki.
I'll take a look at the example and see what it does. I wrote a couple of simple lines yesterday, before my rootfs stopped working with htcunid, but I liked their functionality, basically plain text files - sms-log calls-missed calls-accepted calls-made with timestamps and caller ids. If it's different than your example, I'll add it.

Quote
Quote
EDIT3: The htcunid-0.3 package gives me problems when accepting a call. The call ends in a couple of seconds and the phone freezes.
I'll look into this.  Could be a problem with the whiptail script.
I'll let you know in a little while if there's a prob with it, since I've started clean with your rootfs.

Quote
I used the packages from http://yonggun.tistory.com/54
Thanks.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #76 on: April 19, 2008, 11:50:43 am »
Quote from: ShiroiKuma
How hard is UTF-8 to implement? This is one thing pretty import for me due to using UTF-8 text a lot, but beyond my scope of contribution...
Should be easy to decode.  I've never written python code to handle UTF-8, though, so I'll need to read up on that.

Quote
One can just type on the hardware keyboard and if it'll sent DTMF tones it's fine.
I've found out how to send DTMF, so I can add a new command to the next version of htcunid.  You can do it with the current version by using AT commands:
Code: [Select]
htcunid atcmd "AT+VTS="You can only enter one digit at a time this way.  If you can work out a way to do this during a call, please do.  We're reaching the limits of what whiptail can do.  Probably something like:
Code: [Select]
whiptail --infobox "In call to $2" 20 50
while [ "$digit" != "^[" ]; do
  # Get 1 keypress
  read -n 1 digit
  # Convert esc (hangup key) to "^[" so it's easier to handle
  digit=`echo "$digit" | cat -v`
  case "$digit" in
  1|2|3|4|5|6|7|8|9|0|"*"|"#")
    htcunid atcmd "AT+VTS=$digit"
 ;;
  esac
done
Edit:  This works (albeit slowly  -  I may need to send some more AT commands to set the speed).  I've updated the whiptail script on the wiki.

If you don't already know: you can get out of the "In a call..." screen without ending the call by pressing alt+left (alt is the "internet explorer" key).
« Last Edit: April 19, 2008, 12:33:22 pm by datathief »

danboid

  • Hero Member
  • *****
  • Posts: 881
    • View Profile
    • http://
Htc Universal
« Reply #77 on: April 19, 2008, 12:32:31 pm »
Oh Wow!

Big congrats datathief on some legendary hacking - getting Debian working well on the Uni - many of us on OESF have speculated on the joy of fully functional Linux on the Uni for years now so its great to see it finally happen - I've been getting all excited reading this thread

Problem for me now is what should I spend my limited cash on - a HTC uni or should I wait for the Pandora? I really quite fancy Pandoras TV-out, better graphics, CPU and display but I would rather it dumped the analogue sticks or something to make way for our all important TAB, ALT, CTRL and ESC keys we all need to use a terminal properly, so this for me is an advantage of the Z over Pandora- full set of keys. Uni also has a better keyboard than Pandora (if the current renderings closely approx. the final design of course) and I like that it has an integrated phone and camera- two cool features missing on Pandora. I'd rather a better keyboard than a joypad as I'm more interested in a pocket Linux/Haiku machine than a gaming device.

Can you get USB HOST under HTC Titchy?

What is mplayer performance like on HTC versus mplayer on the Z?

How well does the uni overclock? Be interested to see some benchmarks versus a fully overclocked SL-3000/3100

I think Debian on the Uni represents the arrival of the 'digital convergance' the tech press/ industry has been talking about since the Amiga days- there's a lot of Pandora nay-sayers esp. on these boards but I think that and similar devices will take this phenomenon mainstream sooner than you think.
Zaurus SL-C3000 w/ MD swapped for a Kingston 32GB Ultimate 266X CF running ALARM
Banana Pi running ALARM on a WD Scorpio SATA II HD
System76 Gazelle Pro i7 laptop w/ SAMSUNG 840 EVO SSD running Arch x64

How to install Arch on your C3x00 Zaurus https://github.com/danboid/ZALARM-install

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #78 on: April 19, 2008, 12:59:30 pm »
Quote from: danboid
Oh Wow!

Big congrats datathief on some legendary hacking - getting Debian working well on the Uni - many of us on OESF have speculated on the joy of fully functional Linux on the Uni for years now so its great to see it finally happen - I've been getting all excited reading this thread
I can only take credit for bringing all the bits together (kernel from handhelds.org, Debian's new armel port, and lots of documentation on AT commands).

Quote
Problem for me now is what should I spend my limited cash on - a HTC uni or should I wait for the Pandora? I really quite fancy Pandoras TV-out, better graphics, CPU and display but I would rather it dumped the analogue sticks or something to make way for our all important TAB, ALT, CTRL and ESC keys we all need to use a terminal properly, so this for me is an advantage of the Z over Pandora- full set of keys. Uni also has a better keyboard than Pandora (if the current renderings closely approx. the final design of course) and I like that it has an integrated phone and camera- two cool features missing on Pandora. I'd rather a better keyboard than a joypad as I'm more interested in a pocket Linux/Haiku machine than a gaming device.
I just like telling people my ringtone is a shell script.  

Quote
Can you get USB HOST under HTC Titchy?
As far as I know the hardware doesn't support it (an unconnected pin somewhere IIRC).

Quote
What is mplayer performance like on HTC versus mplayer on the Z?
I haven't a clue.  Maybe later this weekend.  I'm sure I've read somewhere that the Uni's video performance is poor, though.

Quote
How well does the uni overclock? Be interested to see some benchmarks versus a fully overclocked SL-3000/3100
Code: [Select]
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
624000

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #79 on: April 19, 2008, 02:48:50 pm »
Quote from: ShiroiKuma
Quote
Quote
EDIT3: The htcunid-0.3 package gives me problems when accepting a call. The call ends in a couple of seconds and the phone freezes.
I'll look into this.  Could be a problem with the whiptail script.
I'll let you know in a little while if there's a prob with it, since I've started clean with your rootfs.
There is no problem with the deb, it works fine. It was associated with using the other rootfs.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #80 on: April 19, 2008, 03:03:07 pm »
Quote from: datathief
Quote from: ShiroiKuma
How hard is UTF-8 to implement? This is one thing pretty import for me due to using UTF-8 text a lot, but beyond my scope of contribution...
Should be easy to decode.  I've never written python code to handle UTF-8, though, so I'll need to read up on that.
That's great news, if you can get that done. BTW, it should go both ways, decode and encode - for sending UTF-8 SMS messages.

Quote
This works (albeit slowly  -  I may need to send some more AT commands to set the speed).  I've updated the whiptail script on the wiki.
I'll test how it reacts.

Regarding your SMS and calls logging, I didn't look in /root/ originally, that's why didn't notice you had it going on. Essentially, my hacks were almost identical.

However, I've modified it for myself a bit, and propose the same modification to your scripts: basically have 5 logs: log-sms-received.txt log-sms-sent.txt log-calls-received.txt log-calls-made.txt log-calls-missed.txt

In the example script, you carry out logging for sms-received in the receivesms section, calls-made in the dial section, calls-received in the answer section.

In the whiptail script, you carry out logging for calls-missed in the ring2 section, whereby you have your if definition, after which I add an else section:
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']else
   htcunid hangup
   echo "`date` $2" >> $LOGCALLSMISSED
   openvt -w -s -- whiptail --clear --fb --msgbox "`date`, missed call from $2"
   htcunid hangup
fi[/div]

Obviously, you define LOGCALLSMISSED at the top of the script.

This way it also has the benefit of popping up an info box that you see when you return to the phone, that you've missed a call(s)...

And to carry out logging for sms-sent, I just added an sms script:
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']LOGSMSENT=...wherever...
echo "`date` $*"
htcunid sendsms $*[/div]

Other comments so far:

I have problems with suspend, when suspending with [div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']echo mem > /sys/power/state[/div] it's fine, however as soon as you close the lid, it comes back on. Apparently something triggers a key event or what upon close and it brings it out of suspend?

Do you have the same behavior?

Finally, I can't find the backlight incremental change scripts you mentioned earlier, anywhere in your wiki...

Later.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #81 on: April 19, 2008, 03:52:10 pm »
Quote from: ShiroiKuma
In the whiptail script, you carry out logging for calls-missed in the ring2 section ...
I'd like to build a logging script separate from the whiptail script (at some time in the future someone's going to insist on an X-based UI  ), but I imagine it will be difficult.

Quote
I have problems with suspend, when suspending with
Code: [Select]
echo mem > /sys/power/state it's fine, however as soon as you close the lid, it comes back on. Apparently something triggers a key event or what upon close and it brings it out of suspend?
Yes, that is annoying  -  opening and closing the lid triggers an interrupt.  I'll try to find out how to turn the interrupt off.

I use screen's "idle" setting to run apm --suspend after 2 minutes with no keyboard activity  -  so I can close the lid and it will suspend later.  I'm sure there's a way to do the same thing in X.

Quote
Finally, I can't find the backlight incremental change scripts you mentioned earlier, anywhere in your wiki...
Oops.  I'll put it up now.

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #82 on: April 19, 2008, 09:58:25 pm »
Quote from: ShiroiKuma
How hard is UTF-8 to implement? This is one thing pretty import for me due to using UTF-8 text a lot, but beyond my scope of contribution...
I've uploaded a Unicode-capable htcunid.  It works for me (although whiptail doesn't always cope).  Let me know if it works for you...
Update: The problem with whiptail seems to be that the new VT created by openvt doesn't have UTF8 support.  If I change the script to run unicode_start, I get the correct characters in the SMS, but the dialog border is broken.  I'm looking into it.
« Last Edit: April 20, 2008, 07:25:01 am by datathief »

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #83 on: April 20, 2008, 07:33:39 am »
Quote from: datathief
Quote from: ShiroiKuma
How hard is UTF-8 to implement? This is one thing pretty import for me due to using UTF-8 text a lot, but beyond my scope of contribution...
I've uploaded a Unicode-capable htcunid.  It works for me (although whiptail doesn't always cope).  Let me know if it works for you...
Update: The problem with whiptail seems to be that the new VT created by openvt doesn't have UTF8 support.  If I change the script to run unicode_start, I get the correct characters in the SMS, but the dialog border is broken.  I'm looking into it.
Yeah, noticed the same. However, the reception works fine in terms of the characters being decoded. They are just not displayed in the dialog properly. The characters received are in UTF-8 and fine, I've confirmed by resending back.

There is a little bug with sending SMS, whereby it doesn't send the correct number of bytes it seems. I.e. if you send an SMS in UTF-8, it sends only one byte per character, i.e. the total byte count of the message sent is the number of characters, whereas for each Unicode character you should send 2 bytes. This results in the message to be truncated by exactly as many bytes as many extended characters are present in the SMS.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #84 on: April 20, 2008, 09:52:15 am »
Quote from: ShiroiKuma
There is a little bug with sending SMS, whereby it doesn't send the correct number of bytes it seems. I.e. if you send an SMS in UTF-8, it sends only one byte per character, i.e. the total byte count of the message sent is the number of characters, whereas for each Unicode character you should send 2 bytes. This results in the message to be truncated by exactly as many bytes as many extended characters are present in the SMS.
Yes, I see that now.  The SMS spec is a bit confusing.    

I''ve (hopefully) fixed it, and uploaded to the wiki.

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #85 on: April 20, 2008, 01:28:01 pm »
Will test soon.

BTW, I've changed your wiki entry for USB connection a bit, as the first line should read:[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']ifconfig usb0 192.168.3.1[/div]
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #86 on: April 20, 2008, 05:40:16 pm »
Quote from: datathief
I''ve (hopefully) fixed it, and uploaded to the wiki.
Unfortunately, still the same. Still truncates the sent SMS.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #87 on: April 21, 2008, 01:42:59 am »
Additional issues with X
I've installed X according to http://yonggun.tistory.com/54 and applied the "2. Use your normal user under X" hack on https://www.oesf.org/index.php?title=1-For_Debian_EABI

Now, the situation is as follows, if I don't enable xdm via /etc/init.d/, first login as root, then /etc/init.d/xdm start, xdm starts, I can login as a regular use fine and the system works.

If I enable xdm via /etc/init.d/, even if I log in as root or the regular user in the xdm login, X starts, but the display doesn't react to touch. It seems xdm doesn't read the .xinitrc from either /root or /home/theuser when started this way and so TSLIB_TSDEVICE is not set among others.

How to solve this?
« Last Edit: April 21, 2008, 01:47:15 am by ShiroiKuma »
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Htc Universal
« Reply #88 on: April 21, 2008, 01:46:48 am »
Accessing other SD partitions
Is anyone successfull in accessing other SD partitions beyond the first one from which debian boots?

I'd like to have a separate swap partition, to be enabled sometimes when needed. Swap partition, because then the SD corruption from frequent access should be limited to it and not corrupt the rootfs. And swap is needed, for instance without it, I cannot generate any locales with dpkg-reconfigure locales, or memory intensive apps will not run.

However when I try to mount the 2nd partition I get[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']mount: special device /dev/sda2 does not exist[/div]
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

datathief

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Htc Universal
« Reply #89 on: April 21, 2008, 03:54:18 am »
Quote from: ShiroiKuma
Quote from: datathief
I''ve (hopefully) fixed it, and uploaded to the wiki.
Unfortunately, still the same. Still truncates the sent SMS.
Sorry  -  the way I was testing it wasn't actually sending Unicode messages.  I've uploaded another one.