# What SPI 3.2 control port to use for cli tool?

**URL:** <https://in-thread.sonic-pi.net/t/what-spi-3-2-control-port-to-use-for-cli-tool/3433>\
**Category:** Support, Help & Resources\
**Created:** [March 10, 2020, 11:51pm UTC](https://in-thread.sonic-pi.net/t/what-spi-3-2-control-port-to-use-for-cli-tool/3433 "2020-03-10T23:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lozdown](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@lozdown](https://in-thread.sonic-pi.net/u/lozdown)\
**Post date:** [March 10, 2020, 11:51pm UTC](https://in-thread.sonic-pi.net/t/what-spi-3-2-control-port-to-use-for-cli-tool/3433/1 "2020-03-10T23:51:00Z")

</div>

I have built spi 3.2 on ubuntu 19.10 which runs well with OSC running on port 4560. See this post [http://in-thread.sonic-pi.net/t/ver-3-build-script-for-sonic-pi-3-2-0-for-raspberry-pi/3369/11](http://in-thread.sonic-pi.net/t/ver-3-build-script-for-sonic-pi-3-2-0-for-raspberry-pi/3369/11)

However the commandline tool I have been using to control earlier versions of spi - a much modified version derived from [sonic-pi-tool.py](https://github.com/emlyn/sonic-pi-tool) - no longer works. (it worked well on spi 3.01) I am guessing I am using the wrong port to send commands to spi 3.2 (on previous spi versions I have been using 4557)

I am cross developing a theremin inspired music box on ubuntu 19.10. Spi is controlled by the python script as part of this music box. The same code base also runs on a raspberry pi that runs headless.

Please can someone help me out?

---

<div class="post-metadata">

**Author:** ![chris.krakou](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@chris.krakou](https://in-thread.sonic-pi.net/u/chris.krakou)\
**Post date:** [March 11, 2020, 7:03am UTC](https://in-thread.sonic-pi.net/t/what-spi-3-2-control-port-to-use-for-cli-tool/3433/2 "2020-03-11T07:03:16Z")

</div>

Just in case you haven’t found this, there were a few changes to OSC in version 3.2. You might want to give the [changelog](https://github.com/samaaron/sonic-pi/blob/master/CHANGELOG.md#v3.2.0) a read.

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [March 11, 2020, 7:11am UTC](https://in-thread.sonic-pi.net/t/what-spi-3-2-control-port-to-use-for-cli-tool/3433/3 "2020-03-11T07:11:35Z")

</div>

The port is dynamically allocated now. You can determine actual port in use from the server-output log file. I found the same issue with the [sonic-pi-cli tool](https://github.com/Widdershin/sonic-pi-cli), and proposed a solution over a year ago which has now been adopted in the latest version 0.1.3  
If it does not detect the information in the log file then it assumes an earlier version of Sonic Pi and reverts to the previous port 4557.

A similar technique could be applied to the sonic-pi-tool.py script. In the meantime sonic-pi-cli will perform the same job.
