How do I import SIM card contacts?
#1
How do I make the contacts stored on my SIM card visible to my PinePhone, or import them into whatever system it uses?

When I launch the "Phone" app, the "Contacts" tab simply says "No contacts have a phone number yet".  And if I instead launch the "Phonebook" app, it just says "No contacts" and the only way of adding one is to manually fill in a form.

I searched the forum and found a few other threads on this topic but it seems what the questioners are really asking about is contacts stored as VCF files on an SD card, not contacts stored on a SIM card.
  Reply
#2
I followed a suggestion to install Evolution. When you import your contacts into Evolution they are magically also installed into your Pinephone contacts. You can then remove Evolution and your contacts will be retained in the contacts app.
  Reply
#3
(01-19-2022, 05:14 PM)gilwood Wrote: I followed a suggestion to install Evolution. When you import your contacts into Evolution they are magically also installed into your Pinephone contacts. You can then remove Evolution and your contacts will be retained in the contacts app.

How did you manage to run the importer?  For me it doesn't fit on the phone's screen, so it's impossible to work my way through the dialogs.  Running
Code:
scale-to-fit org.gnome.Evolution
scales the main Evolution window to the screen size, but not the importer.
  Reply
#4
(01-19-2022, 05:14 PM)gilwood Wrote: I followed a suggestion to install Evolution. When you import your contacts into Evolution they are magically also installed into your Pinephone contacts. You can then remove Evolution and your contacts will be retained in the contacts app.

Oh, I finally was able to run the importer by simply rotating the screen.  (Silly me!)  But I don't see any way of using it to import SIM card contacts.  It asks whether to import data from another application or from a single file.  If I select "application", I just get a message saying that it can't find any data to import.  And if I select "file", it asks me to select a file, but where do I find the contacts stored on the SIM card?  I don't see it anywhere on the file system; the SIM card storage also doesn't seem to be mounted as a separate filesystem.
  Reply
#5
I'm not aware of any app solution for this yet (there very well may be one, I haven't searched), but you can access the SIM card's phonebook through AT commands. Check out the section on "AT+CPBR" in the modem's command reference. You could write a little script that parses and formats the command output into a vcf file (or do it by hand) and then import that with evolution.

Example of reading the first phonebook entry of the SIM card using mmcli (ModemManager) to send AT commands:
Code:
mmcli -m any --command='AT+CPBR=1'
 
edit: To read all entries (maximum number of entries might vary, not sure, check the supported indices with 'AT+CPBR=?'):
Code:
mmcli -m any --command='AT+CPBR=1,250'
  Reply
#6
(01-20-2022, 06:02 AM)kqlnut Wrote: I'm not aware of any app solution for this yet (there very well may be one, I haven't searched), but you can access the SIM card's phonebook through AT commands. Check out the section on "AT+CPBR" in the modem's command reference. You could write a little script that parses and formats the command output into a vcf file (or do it by hand) and then import that with evolution.

Thanks; this was exactly what I was looking for!  I was able to extract all the contacts this way and a simple sed script put them in VCF format.  Evolution had no problem importing this file.
  Reply
#7
You can enter your contacts into a Google account, then download them to a *.vcf file.

In PMOS, the evolution import works. I attached an external monitor to see the whole screen. I have the 2021 Community edition base Pinephone, which comes with a docking hub for no extra cost - Highly recommend!

In Manjaro, the phone book app can directly import a *.vcf file.

P.S. you can also install a nextcloud server on your own computer, enter the contacts there. Supposedly you can connect to that for contacts in PMOS. However, you have to make it a https service or the app refuses to connect...
  Reply
#8
(01-31-2022, 01:01 PM)undata Wrote: You can enter your contacts into a Google account, then download them to a *.vcf file.

No, I'm pretty sure that you can't.  Apart from mmcli, no one has identified any software available for the PinePhone that is capable of reading the contacts off the SIM card, which is a prerequisite for entering them into a Google account.  But I'm pretty sure that Google provides no web interface that accepts raw SIM card contact data anyway.

In short, what you are proposing might work if you have access to a second smartphone—one that runs Android (which is capable of reading SIM card contacts) and is linked to a Google account—but it's not a solution for someone who has only a PinePhone running Manjaro or some other free software OS.
  Reply
#9
Code:
#!/bin/awk -f
BEGIN{FS=","}
{
gsub(/"/,"",$2)
gsub(/"/,"",$4)
print "BEGIN:VCARD"
print "VERSION:4.0"
print "FN:"$4
print "TEL;TYPE=cell:"$2
print "END:VCARD"
}
save the above as mmcli2vcf.awk, and then run
Code:
mmcli -m any --command='AT+CPBR=1,250' | awk -f mmcli2vcf.awk > contacts.vcf
to get the contacts.vcf, ready for importing
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't add micro SD card to Pinephone thorensjubilee 7 3,002 02-27-2023, 10:21 AM
Last Post: mikehenson
Question Problem with booting from SD card. Several errors LittleStone 0 921 09-04-2022, 02:34 PM
Last Post: LittleStone
  nextcloud contacts are duplicating Uturn 1 2,016 10-24-2021, 01:35 AM
Last Post: user641
Question Backing up contacts prior to OS reinstall danimations 3 2,707 09-27-2021, 03:35 AM
Last Post: kqlnut
  How to import contacts into the phone book app? nelstomlinson 8 7,335 07-18-2021, 03:26 AM
Last Post: Gary2003
  PinePhone Beta Edition will not boot from MicroSD card Timothy_Ecc 8 7,788 04-30-2021, 03:42 PM
Last Post: Timothy_Ecc
  Contacts not Importing mdshell 1 2,341 03-30-2021, 02:24 AM
Last Post: acrux
  Manually mount SD card in running system? lsitongia 3 3,967 03-03-2021, 11:27 AM
Last Post: lsitongia
Sad Cannot play songs directly from SD card SameExpert 2 3,236 01-25-2021, 04:33 AM
Last Post: SameExpert

Forum Jump:


Users browsing this thread: 2 Guest(s)