# Can you talk to a Pi with a PiUART cable and a mobile phone?

**URL:** <https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030>\
**Category:** Support\
**Created:** [October 30, 2018, 7:41pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030 "2018-10-30T19:41:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 30, 2018, 7:41pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/1 "2018-10-30T19:41:29Z")

</div>

OK, so title says it all really.

I have a project in mind where I want to be able to communicate with a Pi (or Zero) via a cable and an Android mobile phone.

Will this Adafruit cable work ?

[https://shop.pimoroni.com/products/adafruit-piuart-usb-console-and-power-add-on-for-raspberry-pi](https://shop.pimoroni.com/products/adafruit-piuart-usb-console-and-power-add-on-for-raspberry-pi)

I think I may have to tinker with `dhcpcd.conf` on the Pi by adding something like:

> interface usb0  
> static ip\_address=192.168.11.2/24

And then open up a Terminal Emulator session.

Anyone got any ideas or pointers.

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![heeed](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/heeed/32/5646_2.png) [@heeed](https://forums.pimoroni.com/u/heeed)\
**Post date:** [October 31, 2018, 12:17pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/2 "2018-10-31T12:17:23Z")

</div>

Interesting question :)

Just out of interest what are you trying to achieve with the connection?

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 31, 2018, 12:42pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/3 "2018-10-31T12:42:10Z")

</div>

I’m thinking of attaching a couple of pHATs to a messenger bag, a pHAT-Bag if you like.

If I want to communicate with the boards, i.e. to run a different Python script, I need to be able to talk to the Pi.

A mobile phone is the easiest device to hand to do this with.

I know that I can connect both the Pi and the phone to a WiFi network and SSH into th Pi, but this process falls down if I am ever using a WiFi network the Pi has no knowledge of (can’t access the Pi to tell it to connect to the new network).

If I can [connect to my SheevalPlug via the JTAG port and talk to it over the serial connection](http://unixetc.co.uk/2013/02/25/connect-to-sheevaplug-usb-from-red-hat/), then a similar process should be possible with the Pi.

?? Maybe ??

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 31, 2018, 12:43pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/4 "2018-10-31T12:43:46Z")

</div>

OK, bought the cable anyway.

It can go and live with all the other cables if this doesn’t work out.

I’ll post my findings if I have any !

Any ideas still appreciated though…

---

<div class="post-metadata">

**Author:** ![heeed](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/heeed/32/5646_2.png) [@heeed](https://forums.pimoroni.com/u/heeed)\
**Post date:** [October 31, 2018, 1:32pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/5 "2018-10-31T13:32:58Z")

</div>

Not though about networking over usb to allow you to configure a connection?

> **[Ethernet Gadget | Turning your Raspberry PI Zero into a USB Gadget | Adafruit...](https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget)**
>
> Go Go Gadget Pi Zero

Also have a look at [https://github.com/heeed/PiSpot](https://github.com/heeed/PiSpot)  
Its something I was playing around with ages ago for having the Pi appear as a hotspot which would then let you connect to reconfigure the WiFi to use another AP if required. It _should_ work on the zero.

hmmm…may have to have a tinker later

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 31, 2018, 2:11pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/6 "2018-10-31T14:11:42Z")

</div>

Thanks for the reply.

This is one of those ideas that has been bouncing around my head for a while, and now I have a bit of tinkering time to fill.

Last time I messed with this I seem to recall that connecting via USB works with a computer, but not a phone.

I can definitely revisit this process though, as it is entirely possible that I cocked something up.

I like the PiSpot approach and is something that I can definitely implement.

I still come back to my original concern though; what about when there is no network to connect through ?

(Maybe I just like the simplicity of an old-fashioned cable.)

Cheers,

Simon.

---

<div class="post-metadata">

**Author:** ![heeed](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/heeed/32/5646_2.png) [@heeed](https://forums.pimoroni.com/u/heeed)\
**Post date:** [October 31, 2018, 2:32pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/7 "2018-10-31T14:32:33Z")

</div>

The basic idea behind PiSpot is for it to start upon boot, look for any known AP and then try to connect in sequence. If none were present or failed to connect it would then start an AP up itself allowing you to connect to it that way.

Did away with the need for cables etc.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 31, 2018, 3:01pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/8 "2018-10-31T15:01:27Z")

</div>

Thanks,

I’ll take a look at it all in a bit.

Cheers for the replies,

Simon.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [October 31, 2018, 10:33pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/9 "2018-10-31T22:33:56Z")

</div>

Hi,

I seem to have ended up in dependency hell.

And, locked myself out.

:-)

> simon@phats:~/git/PiSpot$ sudo bash install\_pispot.sh  
> [sudo] password for simon:
> 
> First, lets see if the req\_files/isc-dhcp-server\_4.2.2.dfsg.1-5+deb70u6\_armhf.deb packages are installed…
> 
> dpkg-query: no packages found matching req\_files/isc-dhcp-server\_4.2.2.dfsg.1-5+deb70u6\_armhf.deb  
> req\_files/isc-dhcp-server\_4.2.2.dfsg.1-5+deb70u6\_armhf.deb is not installed…will install now
> 
> req\_files/isc-dhcp-server\_4.2.2.dfsg.1-5+deb70u6\_armhf.deb  
> Installing locally  
> (Reading database … 150519 files and directories currently installed.)  
> Preparing to unpack …/isc-dhcp-server\_4.2.2.dfsg.1-5+deb70u6\_armhf.deb …  
> Unpacking isc-dhcp-server (4.2.2.dfsg.1-5+deb70u6) over (4.2.2.dfsg.1-5+deb70u6) …  
> **\> dpkg: dependency problems prevent configuration of isc-dhcp-server:**  
> **\> isc-dhcp-server depends on isc-dhcp-common (= 4.2.2.dfsg.1-5+deb70u6); however:**  
> **\> Version of isc-dhcp-common on system is 4.3.5-3+deb9u1.**
> 
> **\> dpkg: error processing package isc-dhcp-server (–install):**  
> **\> dependency problems - leaving unconfigured**  
> Processing triggers for man-db (2.7.6.1-2) …  
> Processing triggers for systemd (232-25+deb9u4) …  
> **\> Errors were encountered while processing:**  
> **\> isc-dhcp-server**  
> cp: cannot stat ‘/etc/default/isc-dhcp-server’: No such file or directory  
> sed: can’t read /etc/default/isc-dhcp-server: No such file or directory  
> sed: can’t read /etc/default/isc-dhcp-server: No such file or directory  
> Setting up autostart of pispot  
> Connection to 192.168.1.65 closed by remote host.  
> Connection to 192.168.1.65 closed.  
> simon@chromebook:~$ ssh phats  
> ssh: connect to host 192.168.1.65 port 22: No route to host

I can pull the SD card tomorrow and try and repair.

Or at least try and get `isc-dhcp-server` up and working.

It looks good though, and I’ll persevere in getting it up and running.

Thanks,

Simon.

---

<div class="post-metadata">

**Author:** ![anon83280986](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon83280986](https://forums.pimoroni.com/u/anon83280986)\
**Post date:** [November 1, 2018, 9:48pm UTC](https://forums.pimoroni.com/t/can-you-talk-to-a-pi-with-a-piuart-cable-and-a-mobile-phone/9030/10 "2018-11-01T21:48:02Z")

</div>

Evening,

Didn’t manage to get the dependencies fixed, but, I managed to get the WiFi back up and running.

PiSpot had addded lines to the `etc/network/interfaces` file.

I think they were coming via the `/boot/ssid.txt` or the `/boot/hotspot.txt` configs.

Removing them back to default (below) got the Pi back online.

**nano /etc/network/interfaces**

> source-directory /etc/network/interfaces.d

There was already a static IP set, as I use SSH keys and a SSH-Config file to connect to the Pi.

**nano /etc/dhcpcd.conf**

> interface eth0  
> static ip\_address=192.168.1.65/24  
> static routers=192.168.1.254  
> static domain\_name\_servers=192.168.1.254  
> static domain\_search=
> 
> interface wlan0  
> static ip\_address=192.168.1.65/24  
> static routers=192.168.1.254  
> static domain\_name\_servers=192.168.1.254  
> static domain\_search=

Still can’t seem to connect to the Zero without going in through WiFi and ssh.

Going to keep on trying…

Simon.
