Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    16

    piCorePlayer and Adafruit Si4713 (FM transmitter)?

    I really love my 6 piCorePlayers (all on raspberry zero).
    To connect my last fm radio to my sound system, I would need a FM transmitter.
    I found the Adafruit Si4713


    It seems to be quite easy to connect this to my raspberry zeros.
    There is also a Python class to get it running.

    Does anyone know if this would run with piCorePlayer?
    How could I do it?

    Thanks in advance
    Gerhard

  2. #2

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Posts
    16
    I just found how to install python on piCorePlayer 3.02:
    tce-load -wi python

    So now I do have python ;-)

    But what to do now?
    How can I install the classes defined at https://github.com/daniel-j/Adafruit-Si4713-RPi ?

    Thanks, Gerhard

  4. #4
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,560
    Quote Originally Posted by gestein View Post
    I just found how to install python on piCorePlayer 3.02:
    tce-load -wi python

    So now I do have python ;-)

    But what to do now?
    How can I install the classes defined at https://github.com/daniel-j/Adafruit-Si4713-RPi ?

    Thanks, Gerhard
    Just put all those files in the same directory, but in addition to the python extension, you also need the python-RPi.GPIO.tcz

  5. #5
    Junior Member
    Join Date
    Oct 2016
    Posts
    16
    I see. Thanks.
    So I am on the right way ;-)

    Is there a special/common place to put these files?
    For installation of the missing python classes, I have to do:
    tce-load -wi python-RPi.GPIO.tcz
    Correct?

    There is a hint at the developers homepage, that the I2C has to be enabled.
    How to do this?

    What do I have to do to start the python script automatically after reboot or shutdown?

    And finally: Which option do I need to choose in the piCorePlayer to get the sound?

    Sorry for all these questions, but I am still a beginner.
    Thanks and best regards
    Gerhard

  6. #6
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,546
    hi gestein,

    Aren't most radio stations available over the internet, hence already available via LMS?

    There is a pCP web page for extensions, from the [Main Page] in [Advanced] mode > [Extensions].

    I2C is already loaded by default in /mnt/mmblk0p1/config.txt ($ m1; c1; vicfg)

    Code:
    dtparam=i2c=on,spi=on,i2s=on
    Also, microPython is already installed on pCP by default. It could be possible to use it instead of Python, but probably would require more effort.

    Remember to expand your SD card to fit all the extra extensions. You will probably double the pCP image size!

    regards
    Greg

  7. #7
    Junior Member
    Join Date
    Oct 2016
    Posts
    16
    Dear Greg,

    yes, that's what I would like to do.
    But still I need some connection between my LMS/piCorePlayer and my already existing radio/speakers (and this has to be done unfortunately by a FM transmitter as there is no aux-in on my radio).

    Thanks for the hint with microPython.
    I will try first, but my knowledge is still very limited.

    Thanks also for the I2C. Good to know.

    So I just need to know how to automatically start the python script at startup and where to put the python files.
    Or is there no restriction about the location of the files?

    Thanks and best regards
    Gestein

  8. #8
    Junior Member
    Join Date
    Oct 2016
    Posts
    16
    Hello,

    Unfortunately I have been away for some time.
    Now I set up an new piCorePlayer and installed python GPIO
    tce-load -wi python-RPi.GPIO.tcz

    After this I made a df
    Code:
    Filesystem                Size      Used Available Use% Mounted on
    tmpfs                   391.1M     10.8M    380.3M   3% /
    tmpfs                   217.3M         0    217.3M   0% /dev/shm
    /dev/mmcblk0p2           42.2M     27.6M     11.2M  71% /mnt/mmcblk0p2
    /dev/loop0                1.1M      1.1M         0 100% /tmp/tcloop/alsa-utils
    /dev/loop1              128.0K    128.0K         0 100% /tmp/tcloop/alsa
    /dev/loop2              128.0K    128.0K         0 100% /tmp/tcloop/busybox-httpd
    /dev/loop3              128.0K    128.0K         0 100% /tmp/tcloop/dialog
    /dev/loop4                1.9M      1.9M         0 100% /tmp/tcloop/openssh
    /dev/loop5                1.1M      1.1M         0 100% /tmp/tcloop/firmware-atheros
    /dev/loop6              256.0K    256.0K         0 100% /tmp/tcloop/firmware-rpi3-wireless
    /dev/loop7              128.0K    128.0K         0 100% /tmp/tcloop/firmware-ralinkwifi
    /dev/loop8              256.0K    256.0K         0 100% /tmp/tcloop/firmware-rtlwifi
    /dev/loop9                8.0K      8.0K         0 100% /tmp/tcloop/wifi
    /dev/loop10              10.0M     10.0M         0 100% /tmp/tcloop/python
    /dev/loop11             128.0K    128.0K         0 100% /tmp/tcloop/python-RPi.GPIO
    /dev/loop12             384.0K    384.0K         0 100% /tmp/tcloop/libasound
    /dev/loop13             256.0K    256.0K         0 100% /tmp/tcloop/ncurses
    /dev/loop14             128.0K    128.0K         0 100% /tmp/tcloop/libedit
    /dev/loop15               1.1M      1.1M         0 100% /tmp/tcloop/openssl
    /dev/loop16             128.0K    128.0K         0 100% /tmp/tcloop/wireless_tools
    /dev/loop17             384.0K    384.0K         0 100% /tmp/tcloop/wpa_supplicant
    /dev/loop18             128.0K    128.0K         0 100% /tmp/tcloop/bzip2-lib
    /dev/loop19             128.0K    128.0K         0 100% /tmp/tcloop/gdbm
    /dev/loop20             116.0K    116.0K         0 100% /tmp/tcloop/readline
    /dev/loop21             512.0K    512.0K         0 100% /tmp/tcloop/sqlite3
    /dev/loop22             768.0K    768.0K         0 100% /tmp/tcloop/alsa-modules-4.4.20-piCore+
    /dev/loop23             128.0K    128.0K         0 100% /tmp/tcloop/libiw
    /dev/loop24               2.8M      2.8M         0 100% /tmp/tcloop/wireless-4.4.20-piCore+
    /dev/loop25             256.0K    256.0K         0 100% /tmp/tcloop/libnl
    Then I made a directory "/mnt/mmcblk0p2/opt/Adafruit-Si4713-RPi" and copied the python classes.
    But when I start python with "python ./radio.py", I get the following error:

    Code:
    Traceback (most recent call last):
      File "./radio.py", line 4, in <module>
        from Adafruit_Si4713 import Adafruit_Si4713
      File "/mnt/mmcblk0p2/opt/Adafruit-Si4713-RPi/Adafruit_Si4713.py", line 10, in <module>
        from Adafruit_I2C import Adafruit_I2C
      File "/mnt/mmcblk0p2/opt/Adafruit-Si4713-RPi/Adafruit_I2C.py", line 3, in <module>
        import smbus
    ImportError: No module named smbus
    But I can not find any modul for the smbus.
    Does anyone know how to solve this?

    Thanks in advance
    Gerhard

  9. #9
    Junior Member
    Join Date
    Oct 2016
    Posts
    16
    Now - I think - I managed to get the smbus-modul.

    Code:
    wget  http://tinycorelinux.net/7.x/armv6/tcz/py-smbus.tcz
    tce-load -i ./py-smbus.tcz
    Is this correct? At least I can start now the python-script.

    Btw:
    There is no "/mnt/mmblk0p1/config.txt".
    How can I check if I2C is enabled?

    Is this the start-up script where I could place my script?
    /opt/bootlocal.sh

    I would place it after the last line in the file with:
    sudo python <path>\radio.py&
    Is this correct?

    Thanks and best regards
    Gerhard

  10. #10
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,560
    The boot drive is not mounted by default. Just mount it to edit the config.

    Yes, /opt/bootlocal.sh is the right place

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •