PINE64
How do I import SIM card contacts? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Manjaro on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=130)
+---- Thread: How do I import SIM card contacts? (/showthread.php?tid=15779)



How do I import SIM card contacts? - Logological - 01-17-2022

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.


RE: How do I import SIM card contacts? - gilwood - 01-19-2022

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.


RE: How do I import SIM card contacts? - Logological - 01-20-2022

(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.


RE: How do I import SIM card contacts? - Logological - 01-20-2022

(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.


RE: How do I import SIM card contacts? - kqlnut - 01-20-2022

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'



RE: How do I import SIM card contacts? - Logological - 01-31-2022

(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.


RE: How do I import SIM card contacts? - undata - 01-31-2022

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...


RE: How do I import SIM card contacts? - Logological - 02-01-2022

(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.


RE: How do I import SIM card contacts? - mruser1 - 06-04-2023

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