Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - DanskFantom

Pages: [1]
Cosmo Communicator - Android / Restoring from Google drive backup
« on: September 10, 2022, 02:08:11 am »
How do you restore an android Google drive backup to the Communicator?

There is no option at boot when doing a sytem restore and no option within Google Drive or System Settings after first booting in.

I've put together this guide for installing KDE Plasma on the Cosmo Communicator.  I've tested the stable part of the installation multiple times on two different Cosmo Communicators and it appears to work consistently.

Time required: 20-40 minutes (depending on the number of optional app packages you choose to install, download speeds etc..)

List of Contents
Part 1 (this post): Stable
1. What's Working
2. Installation Guide
3. Optional installation options
4. Notes

Part 2 (next post down)
What's not working / stable

Part 3 (post below that)
APN settings for mobile providers and other useful data

  • v4.4 firmware for the Communicator
  • KDE Plasma Buster (10)
  • WiFi
  • Mobile phone incoming and outgoing calls
  • SMS incoming and outgoing
  • 4G mobile data, including roaming
  • Camera (front and back)
  • USB mouse
  • Wired headphones
  • Sleep / wake on opening and closing lid
  • Codi as touchpad when open and info screen when lid is closed - time/date, battery / 4G / Wifi icons
  • Full desktop instrallation (Firefox, Thunderbird, Calligra for office and a range of other apps) (updated 15.09.2022)
  • Multiple users (updated 10.09.2022)
  • Printing (updated 13.09.2022)

# 03 SEPT 2022

#Start with a clean install of V4 firmware and KDE Linux by following the links and instuctions on the Planet website
#-install the latest cosmo firmware
#-install the latest KDE linux distribution

#before rebooting I recommend connecting a USB-C mouse to the left port, making sure the Communicator is fully charged

#boot into Linux and login as cosmo with default password cosmo.
#open the terminal program
#open the webbrowser to this page so you can copy and paste the commands into the terminal

#Security step: change the password
#IMPORTANT: Do NOT use a password with a 'k' in it, as there is a bug in the Gemian screensaver and the K key does not work!
Code: [Select]
sudo passwd cosmo

#connect to a wifi network using the Networks plasmoid in the widgets bar
#you should select Classic Blowfish encrypted file to store the password and enter a password for the keychain

#Unfortunately deb buster main has been taken down by Planet
#and have been down for several months at the time of writing
#This means that you can't install any software (meaning you can't install a working Linux)

#My workaround to get software installed is to comment it out in the sources list.

#vi can be flaky and we can't install vim yet, so use nano to edit the file
Code: [Select]
sudo nano /etc/apt/sources.list.d/gemian.list
#comment out the currently offline old V3 firmware planet repository
Code: [Select]
deb buster main
#deb buster main
#save the file and exit

Code: [Select]
sudo apt update#when asked about accepting that the repository has changed from stable to oldstable, select 'yes'
#See comment from Shymega below who recommends not using this workaround, but note it is currently the
#only way to install Linux and there is no timescale for the reps to be back up.

#Install vim as a replacement for vi and unzip which we'll need later
#The GUI for users is missing from the Cosmo linux image, so install it from the command line at the same time
Code: [Select]
sudo apt install vim unzip user-manager

#replace USERNAME below with your new user's username
Code: [Select]
sudo adduser USERNAME#IMPORTANT: Do NOT use a password with a 'k' in it, as there is a bug in the Gemian screensaver and the K key does not work!

#create a copy of the cosmo home folder as your new homefolder
#replace USERNAME with your new username in the lines below
Code: [Select]
cd /home
Code: [Select]
sudo cp -Lvr cosmo USERNAME
Code: [Select]
Code: [Select]
#for the Cosmo Communicator to work, the new user needs to be added to the same groups as the cosmo user
#(which we can see using the 'id cosmo' command)
#we use usermod -a (to append, otherwise the user will be removed from any other groups at the same time)
Code: [Select]
sudo usermod -a -G cosmo,dialout,sudo,audio,video,input,aid_system,aid_radio,aid_graphics,aid_audio,aid_media,aid_net_bt_admin,aid_net_bt,aid_inet,aid_net_raw,aid_net_admin,aid_wakelock USERNAME
#open the User Manager GUI via Application Manager (System Settings -> Account Details)
#and check your new login now has administration privileges (you can change your avatar at this point as well)

#now log out of the user cosmo and login to your user account

#connect to a wifi network using the Networks plasmoid in the widgets bar
#you should select Classic Blowfish encrypted file to store the password and enter a password for the keychain
#to avoid entering the password with each reboot search for and open the Connections app via the Application Launcher
#and select the WiFi Security tab for the network and select "Store Password for all users non encrypted" from the
#drop down list and apply changes.

#open the terminal application - you might need to set up a new profile and then change back to the default profile
#to get terminal working properly again.


#Downgrading Droid Hybris with V3 is reqired to get incoming calls working

#Copy the Droid Hybris zip file to the desktop and open the zip

Code: [Select]
cd ~/Desktop

#change the permissions to root and move the files to /usr/libexec/
Code: [Select]
sudo chown -R root:root droid-hybris
sudo cp -r droid-hybris/ /usr/libexec/

#To get messaging working, replace with the patched one dowloaded from github

#download the file to the Desktop
#then copy the library to the correct location
Code: [Select]
sudo cp /usr/libexec/droid-hybris/vendor/lib64/
#we need to stop apt from upgrading codi-app and lxc-android later or they will break
Code: [Select]
sudo apt-mark hold codi-app lxc-android

#to get 4G working we need to switch to connman from network manager

Code: [Select]
sudo apt install connman
#installing Connman usually knocks out the wifi network, so open the wifi plasmoid from the widgets bar
#and tick the wifi box, then select your wifi network again. If you are struggling to get wifi going again, do a reboot.

Code: [Select]
sudo apt install cmst mobile-broadband-provider-info ofono-scripts
#Do NOT unistall network manager as this seems to break parts of the installation
#NOT TO BE USED: sudo apt remove network-manager plasma-nm

#REBOOT the system
Code: [Select]
sudo reboot

#OPTIONAL: if you ned to enable roaming, use this command
Code: [Select]
#set up the APN
#I've used EE as an example here, but I've listed the code for various other providers in a separate post below
#or search online for your provider's APN settings

#add the EE mobile APN settings and turn on the access point
Code: [Select]
/usr/share/ofono/scripts/set-context-property 0 AccessPointName everywhere
/usr/share/ofono/scripts/set-context-property 0 Username eesecure
/usr/share/ofono/scripts/set-context-property 0 Password secure

#Turn on mobile data
Code: [Select]
/usr/share/ofono/scripts/activate-context 1#NOTE you will usually need to turn on mobile data (and roaming, see above) after the Cosmo has been suspended or restarted
#you can set up an alias for this to make it simpler (see 'optional' section below)

#Check the mobile data status in the Connman app
#there is no connman plasmoid so you need to access the app by searching in Application Manager

#remember to set connman to start at system start in the startup section of the the system settings GUI.

#Gemian is a minimal KDE plasma distro with just a tiny number of apps pre-installed
#(This is not a bad thing, as KDE normally installs with a bunch of apps which can be hard to remove)

#OPTION 1: Install a full KDE Desktop suite of apps, games etc..
Code: [Select]
sudo apt install firefox-esr thunderbird juk yakuake calligra okular wget partitionmanager kup-backup autokey-gtk kcalc knotes vlc ark korganizer skanlite kblocks blinken bomber bovo granatier kanagram kapman kblackbox kblocks kbreakout kdiamond kfourinline khangman killbots kiriki kjumpingcube klickety kmahjongg kmines knavalbattle knetwalk kollision kpat kshisen ksquares picmi filelight kcharselect kcolorchooser kdenetwork-filesharing kompare krdc krfb kruler ktimer kalzium katomic kbruch kgeography kig kstars ktouch kwordquiz marble minuet parley step kturtle kapptemplate kdebugsettings kdesdk-scripts kdevelop okteta umbrello
#OPTION 2: Install my recommended minimal install of apps
Code: [Select]
sudo apt install firefox-esr thunderbird clementine yakuake calligra okular wget gparted kup-backup autokey-gtk kcalc knotes vlc ark
#OPTION 3: Install your own selection of apps
#See the post below for a list of individual apps that appear to install ok

#Install printing packages
Code: [Select]
sudo apt install libnss-mdns  printer-driver-all avahi-discover print-manager
#we need to add admin users to lpadmin otherwise they won't be able to make changes to print settings
#substitute your user name for USERNAME below
Code: [Select]
sudo usermod -a -G lpadmin USERNAME
#You can now use the GUI Printer section in System Settings to add and modify printers
#NOTE I've had issues with network printers not printing, although this may just be par for the course in Linux printing


#add aliases to the .profile
Code: [Select]
vim ~/.profile
#append the following lines:
#(to edit a file in vim, remember to press the i key to enter 'input mode')
Code: [Select]
alias la='ls -la'
alias vi='vim'
alias roamon='/usr/share/ofono/scripts/set-roaming-allowed'
alias mobiledataon='/usr/share/ofono/scripts/activate-context 1'
alias backlight0='echo 40 > /proc/aw9524_led_proc'
alias backlight20='echo 41 > /proc/aw9524_led_proc'
alias backlight40='echo 42 > /proc/aw9524_led_proc'
alias backlight60='echo 43 > /proc/aw9524_led_proc'
alias backlight80='echo 44 > /proc/aw9524_led_proc'
alias backlight100='echo 45 > /proc/aw9524_led_proc'
alias blon=backlight100
alias bloff=backlight0
#save the file in vim by
hitting ESC
type in
Code: [Select]
:wqand hit ENTER

#this will allow you to use terminal aliases to set mobile data and keyboard backlight as the GUIs can be flaky
#for example: the backlit keyboard brightness is set via the battery plasmoid on the widgets panel
#and the 4G is set from the Connman UI setup app via the Application Launcher

#the backlit keyboard can now be controlled with commands from the terminal
Code: [Select]
source ~/.profile
Code: [Select]
Code: [Select]
Code: [Select]
#turn roaming and mobile data on from the terminal:
Code: [Select]
Code: [Select]

#remember you'll need to source the profile file when you open a terminal app if you've not set it up to load it by default
Code: [Select]
source ~/.profile

###########IMPORTANT NOTES##############

USB mice only work if connected before booting.  Once connected and working, they can be removed and reconnected without apparent issue until the next reboot (ie: you need to have it connected at the start of each boot cycle, but otherwise it can be removed and reinserted apparently as often as you like - which is good because you will need to remove it to charge the phone!)

Note that when using wired headphones, you may need to search for "sound" on the application list and open Audio Volume app and then select "Output to wired headphone" from the dropdown list, otherwise the sound will also come out of the speakers. 
Sound can suddenly re-start on the speakers as well as headphones, for example when starting a video playback.
This does NOT always auto revert on removing the headphones, so to avoid missing telephone calls etc.. remember to check your speaker volume and manually re-select "Output to speaker" from the dropdown
list if needed when you remove your headphones!
If the sound from the speakers is very low even when turned up, use the sound control to reselect output to the speakers.

Phone calls will ring whether the phone app is open or not, and whether the phone is in sleep mode or not, open or closed lid etc..

However, the notification sound for the SMS is very quiet, and so I recommend keeping the SMS app open at all times.  I'm not even sure that SMS will be delivered if the app is not open.  Strangely the app has numbers of messages next to each sender, but those numbers don't change when you read messages so you can't rely on that to indicate a new message has arrived (unless you can remember what the previous number was!)

Note: removing and reinserting a sim card seems to require a reboot to take effect.

If your SIM is locked, you should try to unlock it wth
Code: [Select]
/usr/share/ofono/scripts/enter-pin pin <pin_number>

If cmst shows a working connection but you can't browse the Internet, it might be because the
#DNS has not been automatically populated. In this case you can set one using the following command:
Code: [Select]
sudo echo "nameserver" > /etc/resolv.conf

This panel is missing and can't be installed because Gemian has a custom screenlocker (presumably to allow the phone to work)
So altering the screen locker (eg: image) needs to be done via terminal
See instructions here:

The left port works for charging or peripherals.  The right port does not function for either.
See section in PART 2.

Does not seem to connect to anything.
See section in PART 2.

Linux will drain the battery faster than android - I find I need to charge the phone every few hours depending on useage.

I've had issues where sometimes the phone has crashed when charging overnight requiring a reboot
This will obviously result in missed calls, loss of unsaved work etc..

Occassionally the boot will hang on the Debian logo screen.
If this happens force reboot by holding fn and esc down for several seconds until the phone vibrates.
It seems that pressing a key such as tab, space, / or enter during when the Debian logo reduces the chances of it hanging?

It seems that HDMI will not work in Linux, perhaps due to the Kernal being older.

It appear ok to delate the cosmo user and home folder, either in the command line or in the GUI.
This seems like a good thing to do from a security perspective as the username cosmo is publicly available
I would recommend making a copy of the home folder somewhere to use as a default home folder for any future users.
I also recommend adding an additional user using the instructions above as a backup admin user in case you lock yourself out

Installing autokey to allow mimicking of the function keys is discussed here:

#Note: the Fn key on the Communicator is hardwired and not accessable by autokeys

#If you did not do so already, install autokey (the KDE version is not listed in the repos, so I've used the GTK gnome version)
Code: [Select]
sudo apt install autokey-gtk
#Autokey allows mapping a key combination to eg· <f11> so that the fullscreen shortcut works in firefox


#see below for PART 2 where I list installations and actions that are unstable.

Pages: [1]