PicoTuner Ethernet Interface

From BATC Wiki
Revision as of 14:38, 26 September 2024 by G4EWJ (talk | contribs) (→‎Updates, News and Issues)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PicoTunerWH (PicoTuner in WinterHill mode)

PicoTuneWH is software for the BATC PicoTuner. https://wiki.batc.org.uk/PicoTuner

When the standard USB connected Pico module is replaced by a WIZnet W5100S-EVB-Pico or W5500-EVB-Pico module, this provides two receivers which can be controlled
over the Ethernet connection and can send the received transport streams via the Ethernet connection, similar to a WinterHill. WinterHill Receiver Project

OpenTuner 0.B software may also be used to control PicoTunerWH over the Ethernet connection. https://www.zr6tg.co.za/open-tuner/

W5100s-evb-pico-2.png Picotunerwh1.jpg PicoTuner photo: G6HFS

Updates, News and Issues

The latest information will appear in this section. Please post any questions or problems on the BATC forum: https://forum.batc.org.uk/viewtopic.php?f=15&t=8934

The latest version of the Pico firmware is: Media:PicoTuneWH_ptwh0v3e_UF2.zip

2024-09-26: Use netcat -kluv 9997 to view the broadcast packet on an RPi. netcat -kluvw 0 9997 tends to wind up a processor to maximum.

2024-09-26: Version ptwh0v3e.uf2 will not work with the new W55RP20-EVB-Pico module.

2024-08-20: Version ptwh0v3e.uf2 released.

2024-08-20: Version ptwh0v3c has a problem with applying QuickTune LNB voltage settings. Version ptwh0v3e corrects the problem.

2024-08-16: Version ptwh0v3c.uf2 released.

Quick Start

In case of problems, or to find the PicoTunerWH IP address, see the section on the broadcast packet below. #Broadcast Packet on Port 9997

The LNB voltage is turned on automatically at power up. If LNB voltage is not required, remove the LNB voltage jumpers on the PicoTuner board.

Connect an Ethernet cable.

Load the W5100S or W5500 .uf2 file, depending on the type of Pico module.

If the software loaded is not the correct version for the type of Pico module, the Pico and activity LEDs will repeatedly flash NO in morse (-. ---)

The Pico and activity LEDs will flash HI in morse (.... ..)

There is a three second pause for initialisation.

The Pico then attempts to get an IP address via DHCP.

The Pico and PicoTuner activity LEDs do a single blink every second when waiting for a physical Ethernet link.

The LEDs do a double blink every second when waiting for a DHCP address.

When DHCP is successful, the Pico LED is steady on. The activity LEDs are steady on, until a signal is received..

If the LNB LO is 9750MHz and powered by the PicoTuner or otherwise, the activity LEDs will start flashing after a few seconds, indicating double reception of the beacon.

The received transport stream (TS) data will not be sent anywhere, until a command is received.

Send tuning commands to ports 9921 and 9922. Receive transport streams on ports 9941 and 9942. Receive status info on ports 9901 and 9902 (duplicated on 9903 and 9904).

Use QuickTune, WinterHill utilities or OpenTuner 0.B for control and viewing.

https://github.com/m0dts/QO-100-WB-Live-Tune/releases
WinterHill Receiver Project#Documentation
https://www.zr6tg.co.za/files/open_tuner_0.B_20240714.zip
https://www.zr6tg.co.za/open-tuner/

Overview

There is no control or transport stream transfer by USB. A USB connection is not required.

There are different .uf2 files for the W5100S-EVB-Pico and W5500-EVB-Pico modules.

There is a debug facility over the USB serial port.

This software is compatible with OpenTuner 0.B

Network multicast is not supported.

Fixed IP address is not supported.

A broadcast packet with device and receiver info is transmitted every second on port 9997, even if DHCP is unsuccessful.

If you do not have a WinterHill, see the BATC Wiki, particularly the Documentation and PC Software sections: WinterHill Receiver Project#Documentation

Required Equipment

BATC PicoTuner board or BATC MK2 MiniTiouner with FT2232H replacement board.

WIZnet W5100S-EVB-Pico or W5500-EVB-Pico module.

The Pico + WIZnet Ethernet hat combination should not be used because of voltage regulator issues and the hat is too short to reach the end panel in the BATC PicoTuner.

Software Loading

Connect the USB port to a PC.

Apply power to the PicoTuner while holding down the BOOTSEL button on the Pico module.

On a Pico with two buttons, this is the button nearer the USB socket. The other button is RESET, which can be pressed while holding down the BOOTSEL button.

A virtual disk drive window will open on the PC. Copy the appropriate .uf2 file to it. The PicoTuner will restart.

After the software has been loaded, the Pico can be put into BOOTSEL mode without having to press the Pico buttons. #Getting Into Software Upload Mode

Basic Operation

Connect an Ethernet cable.

Load the W5100S or W5500 .uf2 file, depending on the type of Pico module.

At power up, the Pico and activity LEDs flash HI in morse as a confidence check.

It is possible to connect to the USB serial port to see debugging and receiver information - see below.

An IP address must be obtained by DHCP at startup. After this, the Ethernet cable can be unplugged and plugged.

Each receiver activity LED is steady on when no stations are being received, otherwise it flashes at a speed relative to the TS data rate.

This can be changed by sending a remote command - see below.

If the software loaded is not the correct version for the type of Pico module, the Pico and activity LEDs will repeatedly flash NO in morse (-. ---)

Parameters and Data Throughput

The maximum symbol rate of each receiver is about 10M.

The maximum Ethernet throughput for the two receivers combined is about 16M bits/s. Note that 10MS, FEC 3/4 gives 15M bits/s.

Network multicast mode is not possible.

The Base IP Port is 9900.

If you already have a WinterHill, the Base IP Port can be changed to 9904. This provides receivers 5 and 6.

To do this, on a PicoTuner board, on the 10 pin GPIO header, connect pin 8 counting from the right (GP28) marked 28, to pin 10 (GND) marked G. Alternatively, put a jumper on Pico pins 33-34 (grounding GP28). Reboot.

The Base IP Port can also be changed to other values by sending a command over Ethernet. #Sending Remote Configuration and Control Commands via Ethernet

Finding the IP Address

See the section on the broadcast packet below. #Broadcast Packet on Port 9997

Ethernet MAC and Host Name

The WIZnet chip does not contain a MAC number (12 character network hardware ID).

A MAC is formed at startup using the 6 character Raspberry Pi Pico W manufacturer prefix and the lower 6 characters of the Pico serial number.

E.g. 28:CD:C1:41:97:2E

The lower three bytes of the Pico serial number are also used to form the host name.

E.g. PicoTunerWH-41972E

The host name will be shown in 'attached devices' in the router and possibly when using IP scanners.

DHCP

DHCP is the process whereby a device obtains an IP address from a router.

The DHCP flow can be viewed by connecting to the USB serial port just after power up.

An IP address must be obtained at startup. After this, the Ethernet cable can be unplugged and plugged and the PicoTuner will obtain an IP address using DHCP.

The Pico and activity LEDs do a single blink every second when waiting for a physical Ethernet link.

The Pico and activity LEDs do a double blink every second when waiting for a DHCP address.

The Pico LED is steady on when DHCP is successful.

The DHCP status is displayed over the USB serial port and in the broadcast packet.

If the Ethernet link is lost, the Pico and activity LEDs will display the DHCP status, as above.

QuickTune Setup and VLC reception

Send tuning commands to ports 9921 and 9922 using M0DTS's QuickTune program for QO-100: https://github.com/m0dts/QO-100-WB-Live-Tune/releases

Receive transport streams on ports 9941 and 9942.

Info streams are available on ports 9901 and 9902 (duplicated on 9903 and 9904).

Add 4 to these port numbers if the base IP address has been changed by grounding GP28. See: #Parameters and Data Throughput

whpcviewer (on the BATC WinterHill Wiki) is a multi TS viewer for the WinterHill: WinterHill Receiver Project#PC Software

whpcrxcom (on the BATC WinterHill wiki) can be used to send receive commands: WinterHill Receiver Project#PC Software

LNB PSU Output

The LNB PSU is turned on by default at startup. If you do not want LNB voltage, make sure the LNB PSU jumpers are not fitted on the PicoTuner board.

22kHz tone control control is available.

Second LNB PSU Output

The PicoTuner has only one LNB voltage generator, but a second generator could be fitted manually.

The software will accept WinterHill style remote commands for a second generator (VGY). This can be done by sending a manual command, or with whpcrxcom:WinterHill Receiver Project#PC Software

The Pico pins used are pseudo compatible with those used by a MiniTiouner Pro2.

VGYEN (OFF / ON) is on pin 5 on the 10 pin header counting from the right (marked 07).

VGYSEL (LOW / HIGH) is on pin 6 on the 10 pin header (marked 08).

22K_TX1 the tone generator for VGY, should be taken from pin 20 of the NIM, if required.

Working with a WinterHill

If you already have a WinterHill, the PicoTunerWH can be set to emulate a second one.

Apply the jumper as descibed in the Parameters section above to make the PicoTunerWH behave as receivers 5 and 6.

Add receivers 5 and 6 to the QuickTune configuration, with the PicoTunerWH IP address.

On whpcrxcom, CTRL-R will expand it to 8 receivers. Set the second IP address for the PicoTunerWH. WinterHill Receiver Project#PC Software

Contact G4EWJ for a 16 screen version of whpcviewer.

QO-100 Frequency Self Calibration

After startup, the first receiver is set to the QO-100 beacon and does the calibration. Two seconds later, the second receiver is set to the beacon.
If the LNB has an LO other than 9750MHz, calibrate by putting the beacon on receiver 1 manually.

USB Serial Port Connection

Configuration and receiver status information may be displayed over the USB serial port. There is no TS transfer.

On a PC:

use Device Manager to find the COM port that has been allocated.
use Putty to make a serial connection at 9600 baud.

On an RPi:

Type:
ls /dev
the USB serial port will be something like ttyACM0.
there may be other ttyACM ports and the port allocated may not always be the same.


To find the assigned USB serial port and Pico serial number:
After the .uf2 file has been loaded, unplug and plug the PicoTuner USB cable.
Type:
dmesg
to give a display similar to below:
[ 5270.784596] usb 1-1.4: new full-speed USB device number 10 using xhci_hcd
[ 5270.932417] usb 1-1.4: New USB device found, idVendor=2e8a, idProduct=000a, bcdDevice= 1.00
[ 5270.932438] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5270.932457] usb 1-1.4: Product: Pico
[ 5270.932474] usb 1-1.4: Manufacturer: Raspberry Pi
[ 5270.932491] usb 1-1.4: SerialNumber: E660D4415741972E
[ 5270.947997] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
Note the ttyACM allocation and the serial number.

Using the USB Serial Port on an RPi

Configuration and receiver status information may be displayed over the USB serial port.

Type:

stty -F /dev/ttyACM0 raw -echo & cat /dev/ttyACM0 or whichever tty port has been assigned.

You may need to retry when doing this at the same time as the PicoTuner boots up, if you try it too soon.

The Putty font size may need to be reduced to fit the data - try 11 point:

Change Settings, Window, Appearance, Font Change

Giving the Pico a Fixed tty Name on an RPi

If the Pico software is set to provide a USB serial port, as with PicoTuneWH, the RPi will assign a ttyACM name to it, but it may not be the same every time.

The RPi can assign a fixed tty name to the Pico, based on the Pico's serial number.

This has to be done on every RPi that the PicoTuner is connected to.

Discover the Pico serial number as described above. #USB Serial Port Connection

Type:

sudo nano /etc/udev/rules.d/99-usbserial.rules

Add a new line:

ACTION=="add",ENV{ID_BUS}=="usb",ENV{ID_SERIAL_SHORT}=="E660D4415741972E",SYMLINK+="ttyPT0"

If you have another PicoTuner, add:

ACTION=="add",ENV{ID_BUS}=="usb",ENV{ID_SERIAL_SHORT}=="E660D441576B7F22",SYMLINK+="ttyPT1"

Replace the serial numbers with your own. Replace the tty names with your own choice.

Save and exit

CTRL-X then Y then ENTER

Uplug and plug the PicoTuner.

Type:

ls /dev
to check that ttyPT0 appears.

ttyPT0 will always be assigned to this particular Pico.

A potentially variable ttyACM name will also be assigned.

The command to display the USB serial port data will now be:

stty -F /dev/ttyPT0 raw -echo & cat /dev/ttyPT0

Getting Into Software Upload Mode

Instead of holding down the BOOTSEL button and connecting to USB to get into software upload mode, once this software has been loaded, the Pico can be put into software upload mode again by opening a USB serial port connection at 1200 baud.

Note that this feature depends on the software already loaded on the Pico. G4EML's PicoTuner USB software uses a different method.

On a PC:

find the COM port number with Device Manager and open a serial connection at 1200 baud with putty and then close it. The Pico virtual disk drive should now appear and the .uf2 file can be dragged onto it.

On an RPi:

find the ttyACM serial port that the Pico appears as and type:
stty -F /dev/ttyACM0 1200 (use your own ttyACM port)

The Pico virtual disk drive will now be available.

Broadcast Packet on Port 9997

The PicoTuner sends this every second, even if an IP address cannot be obtained.

=======================================
       PicoTuner Broadcast
---------------------------------------
       Sequence   1294
       Run time   1301s
 Broadcast port   9997
    Pico serial   E6623C3767449A2E
   Net hardware   WIZnet W5500
            MAC   28:CD:C1:44:9A:2E
      Host name   PicoTunerWH-449A2E
     DHCP state   Success
Lease remaining   2305s
     IP address   192.168.77.196
       NIM type   FTS4334L
   LNB supply X   HI
   LNB supply Y   absent
       Software   ptwh0v3e-w5500.uf2
           Mode   WinterHill
   Base IP port   9904
            RX5   10496.700T DD0CW
            RX6   10491.501T A71A
  TS target RX5   192.168.77.247:9945
  TS target RX6   192.168.77.247:9946
=======================================

To display this on an RPi, type:

netcat -kluv 9997

Windows does not seem to have an inbuilt equivalent of netcat, but this very old utility works OK. (Thanks G6HFS)
https://github.com/cyberisltd/NcatPortable Click the green CODE button, then Download ZIP.

In a Command Box, type:

ncat -luv 9997

Sending Remote Configuration and Control Commands via Ethernet

Remote commands may be sent to port 9920 using UDP, when the Base IP Port is 99xx. Case is not important.

If the Base IP Port is, for example, 8804, commands should be sent to port 8820.

Reset: [to@wh] reset=147 clear any remote settings and reboot
Reboot: [to@wh] reboot=258 reboot, but do not clear any remote settings
BOOTSEL: [ to@wh] bootsel=369 go into software upload mode
Base IP Port: [to@wh] bip=9908 change the Base IP Port and reboot
Activity LED action: [to@wh] tsflash=0 activity LEDs are steady on when receiving, otherwise off

Valid Base IP Port settings are any even number from x00 to x14, where x is 11 to 653.
The Base IP Port and TSFLASH values that are set by remote commands, are forgotten when power is removed.

To do this from an RPi, type for example:

echo "[to@wh] bip=9908 tsflash=0" | netcat -uw1 192.168.77.196 9920 using the IP address of your PicoTunerWH
| is the vertical bar character

To do this from Windows, type for example:

echo [to@wh] bip=9908 tsflash=0 | ncat -uvi1 192.168.77.196 9920

Sending Remote Tuning Commands via Ethernet

Tuning commands can be sent in MiniTioune format to ports 9021 and 9922, as used by M0DTS's QuickTune program for QO-100. https://github.com/m0dts/QO-100-WB-Live-Tune/releases

Remote tuning commands may also be sent in WinterHill format to port 9920 using UDP, when the Base IP Port is 99xx.

If the Base IP Port is, for example, 8804, commands should be sent to port 8820.

Case is not important. Commas may be used to separate the parameters.

The command must contain: rcv, freq, offset, srate, fplug (5 parameters plus optionally vgx / vgy) OR ONLY vgx / vgy.

E.g. if the base IP port is 9904, giving receivers 5 and 6:

[to@wh] rcv=5 freq=10491500 offset=9750000 srate=1500 fplug=A (the LNB voltage generator parameter is optional - the parameter is OFF,LO,HI,LOT, HIT)
[to@wh] rcv=6, freq=1304000, offset=0, srate=4000, fplug=A, VGX=HI
[to@wh] VGX=LOT

To do this from an RPi, type:

echo "[to@wh] rcv=5 freq=10491500 offset=9750000 srate=1500 fplug=A vgx=hi" | netcat -uw1 192.168.77.196 9920

To do this from Windows, type:

echo [to@wh] rcv=5 freq=10491500 offset=9750000 srate=1500 fplug=A vgx=hi | ncat -uvi1 192.168.77.196 9920

Serial Port Debug Output after Booting


ptwh0v3e-w5500.uf2 is starting

=======================================================================================================
=======================================================================================================
PicoTuner Dual Channel Digital TV Receiver - WinterHill mode - Version=ptwh0v3e-w5500.uf2
=======================================================================================================
+++ NIM_A FTS4334L initialised +++
=======================================================================================================
Waiting for Ethernet link - 0
Waiting for Ethernet link - 1

DHCP: starting
DHCP: DISCOVER sent - My MAC 28:CD:C1:44:9A:2E - Transaction ID 2DCF9A2E
DHCP: waiting for OFFER
DHCP: OFFER of 192.168.77.196 received from 192.168.77.1
DHCP: REQUEST sent
DHCP: waiting for ACK
DHCP: ACK received
DHCP: +++ SUCCESS +++

==============================================================================================================================================
 PICOTUNER (WH mode) Version=ptwh0v3e-w5500.uf2  RunTime=17s  BasePort=9904  MAC=28:CD:C1:44:9A:2E  IP=192.168.77.196  DHCP=Success
 ---------------------------------------------------------------------------------------------------------------------------------------------
 RX  STATUS   CALLSIGN           MER      D  FREQUENCY     SR  MODULATION   FPRO  CODECS    ANT  PACKETS  %NUL  NIMTYPE   TS DESTINATION
 ---------------------------------------------------------------------------------------------------------------------------------------------
  5  DVB-S2   A71A              10.3    5.6  10491.500   1500  QPSK 4/5     LN20  H264-MPA  TOP    15801   2.9  FTS4334L  0.0.0.0
  6  DVB-S2   A71A              10.2    5.5  10491.501   1500  QPSK 4/5     LN20  H264-MPA  TOP    12488   2.8  FTS4334L  0.0.0.0
==============================================================================================================================================
 Last command (0): [to@wh] rcv=2 fplug=a offset=9750000 freq=10491500 srate=1500