Allocation of Front End II interface compliant device - redhawksdr

I am working REDHAWK 1.9 on Centos 6.4 (32 bit) OS.
I have a device that conforms to the FrontEnd( FE) II interface for a Tuner. The allocation of an FEII compliant device is via a structure (frontend_tuner_allocation). The IDE does not appear to allow to define this allocation on the implementations tab.
I looked at REDHAWK UHD device usage. It describes how to make the necessary connections but I didn't see how to allocate via the tuner allocation structure.
I have seen example (offline) where to do this allocation the allocation structure has to be hand coded into the xml file. I saw in one case this was done in the components spd.xml file. I have another example where it was done in the waveform.
example 1:
In components spd.xml
<usesdevice id="DCE:11bafc63-d8ce-428b-8b4e-39cb96034e8c" type="usesDevice">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND:TUNER"/>
<structref refid="FRONTEND::tuner_allocation">
<simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="SimFE2TestSink"/>
<simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="857000000.0"/>
</structref>
</usesdevice>
example 2:
In waveform spd.xml
<usesdevicedependencies>
<usesdevice id="DCE:93a650f5-719f-4dc3-8143-fd438b94c19f" type="usesXX">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND::TUNER"/>
<structref refid="FRONTEND::tuner_allocation">
<simpleref refid="FRONTEND::tuner_allocation::tuner_type" value="RX_DIGITIZER_CHANNELIZER"/>
<simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="XXDevice"/>
<simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="100000000"/>
<simpleref refid="FRONTEND::tuner_allocation::bandwidth" value="128000"/>
<simpleref refid="FRONTEND::tuner_allocation::sample_rate" value="256000"/>
<simpleref refid="FRONTEND::tuner_allocation::group_id" value=""/>
<simpleref refid="FRONTEND::tuner_allocation::rf_flow_id" value=""/>
</structref>
</usesdevice>
</usesdevicedependencies>
How is the best way to allocate FrontEnd Tuner?

There isn't really a 'best' way to allocate a frontend tuner device. It really just depends on which way makes the most sense for your specific scenario.
The two examples you provided are valid ways of allocating a frontend tuner via XML, but there's another option (using python) that may help clarify what is going on under the hood.
Assuming your device is already running:
from ossie.utils import redhawk
from ossie.cf import CF
# Attach to the domain
domain = redhawk.attach("REDHAWK_DEV")
# Locate your FEI device
myFEIDevice = None
for device in domain.devices:
if device.name == "myFEIDevice":
myFEIDevice = device
# Sanity check
if not myFEIDevice:
raise Exception("Unable to locate myFEIDevice!")
At this point, your FEI device should accept an allocateCapacity(tunerRequestProps) call:
from ossie.utils import uuid
# Setup tuning variables
allocationId = str(uuid.uuid4())
tunerType = "RX_DIGITIZER_CHANNELIZER"
centerFreq = 100e6
sampleRate = 48000.0
sampleRateTol = 10.0
bandwidth = 16000.0
bandwidthTol = 10.0
deviceControl = False
groupId = ""
rfFlowId = ""
# Setup allocation request properties
props = []
props.append(CF.DataType("FRONTEND::tuner_allocation::tuner_type", tunerType))
props.append(CF.DataType("FRONTEND::tuner_allocation::allocation_id", allocationId))
props.append(CF.DataType("FRONTEND::tuner_allocation::center_frequency", centerFreq))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth", bandwidth))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth_tolerance", bandwidthTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate", sampleRate))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate_tolerance", sampleRateTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::device_control", deviceControl))
props.append(CF.DataType("FRONTEND::tuner_allocation::group_id", groupId))
props.append(CF.DataType("FRONTEND::tuner_allocation::rf_flow_id", rfFlowId))
# Setup tuner request struct properties
fe_alloc_props = {}
fe_alloc_props["FRONTEND::tuner_allocation"] = props
# Attempt to allocate your device
allocationResult = myFEIDevice.allocateCapacity(fe_alloc_props)
At this point, if the allocation was successful, you should see the allocation request is now represented in the device's frontend_tuner_status property

Related

Extract only ASINS from product listing page where Price is visible on Amazon

I am trying to generate those urls of the product where price is visible on the listing page i.e https://www.amazon.com/s?k=ps5&rh=p_36%3A27500-65000 and my goal is to skip the remaining of the ASINS where price is not on listing page.
Logic I came up with is something like this:
Grab the Tag which contains all the product listing.
Filter the Tag with if and else condition to extract those specific products with price.
I am struggling through execution I had done some web scraping few months ago and right now I am bit of rusty and trying to keep up with this so any help would be much appreciated.
Here is my function:
from requests_html import HTMLSession
s = HTMLSession()
def get_product_links(session): #
# https://www.amazon.com/s?k=ps5&rh=p_36%3A27500-65000
url = session.get(
base_url + search_term + price_filter,
headers=headers,
)
print(url.status_code)
tag = url.html.find("div[data-component-type=s-search-result]")
price_tag = [pr.find("span.a-offscreen", first=True) for pr in tag]
print(price_tag)
check_price = [price.text for price in price_tag if price != None]
print(check_price)
if len(check_price) > 0:
product_asins = [
asin.attrs["data-asin"]
for asin in url.html.find("div[data-asin]")
if asin.attrs["data-asin"] != ""
]
product_link = [
"https://www.amazon.com/dp/" + link for link in product_asins
]
return product_link
else:
print("Skipping Product...")
To get links only for products which have price you can use this example:
import requests
from bs4 import BeautifulSoup
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0",
"Accept-Language": "en-US,en;q=0.5",
}
url = "https://www.amazon.com/s?k=ps5&rh=p_36%3A27500-65000"
soup = BeautifulSoup(requests.get(url, headers=headers).content, "html.parser")
for asin in soup.select("[data-asin]"):
num = asin["data-asin"].strip()
price = asin.select_one(".a-price .a-offscreen")
if num and price:
print(asin.h2.text)
print(price.text, "https://www.amazon.com/dp/{}".format(num))
print()
Prints:
HexGaming Esports Ultimate Controller 4 Remap Buttons & Interchangeable Thumbsticks & Hair Trigger Compatible with PS5 Customized Controller PC Wireless FPS Esport Gamepad - Wild Attack
$289.99 https://www.amazon.com/dp/B09KMYCY1C
Samsung Electronics 980 PRO SSD with Heatsink 2TB PCIe Gen 4 NVMe M.2 Internal Solid State Hard Drive, Heat Control, Max Speed, PS5 Compatible, MZ-V8P2T0CW
$349.99 https://www.amazon.com/dp/B09JHKSNNG
G-STORY 15.6" Inch IPS 4k 60Hz Portable Monitor Gaming display Integrated with PS5(not included) 3840×2160 With 2 HDMI ports,FreeSync,Built-in 2 of Multimedia Stereo Speaker,UL Certificated AC Adapter
$379.99 https://www.amazon.com/dp/B073ZJ1K8G
Thrustmaster T248, Racing Wheel and Magnetic Pedals, HYBRID DRIVE, Magnetic Paddle Shifters, Dynamic Force Feedback, Screen with Racing Information (PS5, PS4, PC)
$399.99 https://www.amazon.com/dp/B08Z5CX6V2
WD_BLACK 1TB SN850 NVMe Internal Gaming SSD Solid State Drive with Heatsink - Works with Playstation 5, Gen4 PCIe, M.2 2280, Up to 7,000 MB/s - WDS100T1XHE
$189.99 https://www.amazon.com/dp/B08PHSVW7K
Thrustmaster T300 RS - Gran Turismo Edition Racing Wheel (PS5,PS4,PC)
$449.99 https://www.amazon.com/dp/B01M1L2NRL
Seagate FireCuda 530 2TB Internal Solid State Drive - M.2 PCIe Gen4 ×4 NVMe 1.4, PS5 Internal SSD, speeds up to 7300MB/s, 3D TLC NAND, 2550 TBW, 1.8M MTBF, Heatsink, Rescue Services (ZP2000GM3A023)
$399.99 https://www.amazon.com/dp/B0977K2C74
OWC 2TB Aura P12 Pro NVMe M.2 SSD
$329.00 https://www.amazon.com/dp/B07VZ79XQ6
Sabrent 2TB Rocket 4 Plus NVMe 4.0 Gen4 PCIe M.2 Internal Extreme Performance SSD + M.2 NVMe Heatsink for The PS5 Console (SB-RKT4P-PSHS-2TB)
$329.99 https://www.amazon.com/dp/B09G2MZ4VR
Sony Playstation PS4 1TB Black Console
$468.00 https://www.amazon.com/dp/B012CZ41ZA
Thrustmaster TH8A Shifter (PS5, PS4, XBOX Series X/S, One, PC)
$199.99 https://www.amazon.com/dp/B005L0Z2BQ
WD_BLACK 2TB P50 Game Drive SSD - Portable External Solid State Drive, Compatible with Playstation, Xbox, PC, & Mac, Up to 2,000 MB/s - WDBA3S0020BBK-WESN
$348.99 https://www.amazon.com/dp/B07YFG9PG2
Logitech G923 Racing Wheel and Pedals for PS 5, PS4 and PC featuring TRUEFORCE up to 1000 Hz Force Feedback, Responsive Pedal, Dual Clutch Launch Control, and Genuine Leather Wheel Cover
$399.98 https://www.amazon.com/dp/B07PFB72NL
GIGABYTE AORUS Gen4 7000s SSD 2TB PCIe 4.0 NVMe M.2, Nanocarbon Coated Aluminum Heatsink, 3D TLC NAND, SSD- GP-AG70S2TB
$319.99 https://www.amazon.com/dp/B08XY93JT3
THRUSTMASTER T-LCM Pedals (PS5, PS4, XBOX Series X/S, One, PC
$229.99 https://www.amazon.com/dp/B083MNB4D8

My Pressure Sensor Wont Output the Full Range of Values, Using a Raspberry Pi 3 and Python3

I have devised a circuit in which I am getting a pressure reading from a Dwyer 616kd-11-v Transducer with a Range of 0-500Pa, I am powering this with a 5v Power Supply and it shares a common ground to the Raspberry Pi. My ADC converter is a 16 Bit ADS1115 By Texas Instruments. I have connected the transducer and I am getting a reading which is similar to that I am getting on another External Airflow Pressure meter.
The problem is as soon as the Pressure reaches 324Pa or more the Reading in my Python Shell freezes at 324 and does not change until the value has dropped below 324Pa. The Transducer has a range of upto 500Pa meaning it should be able to read upto this value?
I will attach the code I use for this below and will include my basic circuit connections.
Full Code:
import time
import board
import busio
from adafruit_ads1x15.single_ended import ADS1115
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
Transducer = 17
GPIO.setup(Transducer,GPIO.IN)
i2c = busio.I2C(board.SCL,board.SDA)
adc = ADS1115(i2c)
while True:
r0 = adc[0].value
r1 = adc[1].value
ADC_Value = r0*0.01525878906
input_value = GPIO.input(Transducer)
time.sleep(0.5)
print("GPIO17: ", (input_value))
print("AIO: ", (r0))
print("AI1: ", (r1))
print("Pressure: ",(ADC_Value),"Pa")
Connections
the Vdd of the ADC converter has a 0.1uF capacitor with one end to GND and other end to Vdd.
Thanks!!
From the datasheet (http://www.dwyer-inst.com/PDF_files/P_616KD.pdf) it looks like the supply voltage should be 16-36V DC.
I think this will give you a 0-10V output under your current set-up. If you want a 0-5V output, you should connect the output pins 3 and 4 together. You need to make sure you can measure this voltage range on the ADS1115. The default range is only +-4.096V, so you will need to set the gain to its lower settings to read up to +5V.

trouble configuring timings for LVDS display (linux on rk3288)

I'm trying to hook up an LVDS display to my dev board based on rockchip rk3288 and have trouble getting graphics to show on the display.
The display is the GWTS80MNFG1E0 by SGD. The datasheet is here http://www.datadisplay-group.com/fileadmin/pdf/produkte/Displays/SGD/GWTS80MNFG1E0_Datasheet.pdf
Here is the .dtsi file I created for the display:
/ {
disp_timings: display-timings {
native-mode = <&timing0>;
timing0: timing0 {
screen-type = <SCREEN_LVDS>;
lvds-format = <LVDS_8BIT_1>;
out-face = <OUT_P888>;
clock-frequency = <48690000 52590000 60830000>;
hactive = <1656 1660 1760>;
vactive = <490 528 576>;
hback-porch = <5 16 141>;
hfront-porch = <19 44 155>;
vback-porch = <5 5 91>;
vfront-porch = <5 43 91>;
hsync-len = <1 2 140>;
vsync-len = <1 2 90>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
};
};
The problem is that the display turns on but I can't see any graphics. In the .config file for the kernel I have CONFIG_RK32_LVDS=y. The .dts file for the board includes my .dtsi file.
Hardware details:
On my breadboard, interfacing my dev board to the display, I've pulled STBYB, RESET, SELB, RL, and TB high via a 10k pullup to 3.3v.
For backlight I'm using the adafruit tft friend - https://www.adafruit.com/product/1932
I'm taking 5v from my dev board to feed the backlight driver and I've hooked up LED- and LED+ of the display to the backlight driver. The driver is configured to output 75mA at the moment. The adafruit board has specs of outputting up to 125mA at 24V while the SGD datasheet mentions 25.6V. I'm not sure if this is a problem or not.
I have the VSDN/VSDP hooked up to a TPS65132WEVM-669 (texas instruments) which I've programmed to provide +/- 5.5v. This EVM is powered from the same 5v as the backlight driver. I've verified it's outputting the correct voltages.
I've hooked up the display inputs RXIN[0123]+/- to board lvds port outputs D[0123]P/N. Display clock inputs RXCLKIN+/- are hooked up to board lvds port clock lines CLK0P/N.
My questions:
1) is the backlight driver the problem here?
2) is the .dtsi file I created for the display correct?
3) is there anything else I can check w/r/t my kernel / dts config or the hardware itself?
Thanks
B
There are five items which need to be verified:
LVDS settings in dts:
Check the IPU channel which is correctly mapped on the lvds device
data-width (18bit/24bit) of the lvds channel.
LVDS output format for serializer (VESA or Non-VESA format )
Frame buffer settings in dts:
Check your frame buffer settings
- bit pet pixels
- Pixel format
- ipu clock
Kernel command:
Check whether any of the kernel command which is overwrite the dtsi settings during kernel startup.
Backlight:
In order to make the backlight, measure the display current.
Lock:
Check the physical connection between serializer and deserializer. Make sure the LOCK signal.
I had as similar issue after a kernel update, and this kernel "fix" was the problem. Newer kernels (after 2013) fall back on not having any LVDS screen, which mean that you don't see any graphics.
http://marc.info/?l=git-commits-head&m=138449380916013&w=2

Specifying GPIO Numbers for IO Expander in Linux Device Tree

I'm trying to add a PCA9557 I/O expander to an arm-based system on an I2C bus. The system already has another I/O expander on a different I2C bus. I am trying to figure out how to specify which GPIO numbers the pins on the new expander get, and how to get both working.
Here's the device tree section for the existing expander, under I2C bus 2:
i2c2: i2c#e8007000 {
status = "ok";
pca9539: pca9539#74 {
compatible = "nxp,pca9539";
reg = <0x74>;
interrupt-parent = <&gpio>;
interrupts = <9 0x0>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
};
Using the above, the existing I/O expander (with 16 GPIOs) appears in linux as /sys/class/gpio/gpiochip128, exposing GPIO numbers 128 - 143. GPIOs 0-127 are built in to the host processor.
I added the following for the new expander on I2C bus 0:
i2c0: i2c#e8003000 {
status = "ok";
pca9557: pca9557#18 {
compatible = "nxp,pca9557";
reg = <0x18>;
gpio-controller;
#gpio-cells = <2>;
};
I also modified the kernel config to build the GPIO_PCA953X driver, which should support the PCA9557.
When I compile and boot with the above added to the device tree, I now see the NEW expander (PCA9557) mapped as /sys/class/gpio/gpiochip136, and it works (I can set its IO 0 pin using GPIO128).
However, there are no longer any GPIO pins for the other expander. It still appears as a device on the appropriate bus under /sys/devices/... but a directory listing doesn't show the "driver..." and "i2c-2" items which were there before.
So how do I get BOTH expanders to appear in /sys/class/gpio/ with different ranges of GPIO numbers, so I can use both?
I guess the "128" as the base GPIO for the original expander was just the next available GPIO? But why does the new expander end up starting at GPIO 136?
I've seen several references to this page: GPIO bindings documentation, but it was fairly generic and didn't help much.

RaspBerry pi B rev2 - Issue while sampling a LM335 (temp. sensor) thru a MCP3208 ADC via SPI in Python 3

I tried to interface a RaspBerry pi with a LM335 temperature sensor this week-end. I'm using a MCP 3208 micro controller (channel 0) to interface the sensor. My goal is to collect samples data in SPI mode with python 3 scripts (classes).
I've checked the wiring and everything seems OK for me, I'but I'am a beginner, not really aware of Electronic concepts.
On the software side , I've installed quick2wire that claims to be python 3 compatible. In fact I want to lead the micro-controller with Python 3 API's (not thru shell calls)
Components
Raspberry pi REV2 model B with Rasbian-wheezy / Quick2wire installed. /dev/spix.y devices are listed.
MCP3208 ADC : 12 bits ADC / SPI. I'm using CS0 from the GPIO. The sensor is connected to channel 0 (B). see datasheet.
LM335 : temperature sensor. Outputs 10mV / °K. Min 5muA / Max 5 mA. It's connected to the MCP3208 channel #0 (A). see datasheet
220 ohms resistor (C). set up regarding LM335 outputs and desired temperature range coverage with my own calculations : May be a problem ...
Schematics extract
The LM335 (zener diode like) is connected as :
Wiring
Components are wired as shown bellow. Note that the yellow link is connected behind the cobbler kit on the CS0 SPI channel.
Quick2wire
I use the bellow script to query the CS0/Channel 0 GPIO interface. Unfortunately, I've not found usefull informations on the quick2wire-python-api API's. I've just copy/paste an example found as it was written in the same goal. I'm not sure if it really works :
#!/usr/bin/env python3
from quick2wire.spi import *
import sys, time
try:
channel = int(sys.argv[1])
except:
channel = 0
MCP3208 = SPIDevice(channel, 0)
while True:
try:
response = MCP3208.transaction(writing_bytes(0x41, 0x13), reading(1))
print ("output = %i" % ord(response[0]))
time.sleep(1)
except KeyboardInterrupt:
break
The script outputs :
output = 0
output = 0
output = 0
output = 0
output = 0
....
The result is the same with the channel 1 ( with argv = 1)
As the MCP3208 Din (probe output) receives voltage (see bellow) quick2wire should read at 18°C (rawghly my home inside temperature today)
3,3 V / 2^12 = 805 muA as I understand as "digital step"
18°C + 273°C = 291 => 2,91 V on the micro controller Din pin
and then return 2 910 / 0.805 = 3 615
Am I wrong ?
Controls
I've no oscilloscope, the only measures I can read are :
Voltage is 2.529 V at B checkpoint and 0,5 V (+/-5%) on the other MCP3208 channels
Note : the adjust pin is not used on the LM335 so results way not be accurate but voltage is here !
Seems to be a problem on the quick2wire side I think. But which ?
Code
The quick2wire.spi.SPIDevice class lakes of détails on the transfers parameter in terms of structure, content and output response format.
def transaction(self, *transfers):
"""
Perform an SPI I/O transaction.
Arguments:
*transfers -- SPI transfer requests created by one of the reading,
writing, writing_bytes, duplex or duplex_bytes
functions.
Returns: a list of byte sequences, one for each read or duplex
operation performed.
"""
transfer_count = len(transfers)
ioctl_arg = (spi_ioc_transfer*transfer_count)()
# populate array from transfers
for i, transfer in enumerate(transfers):
ioctl_arg[i] = transfers[i].to_spi_ioc_transfer()
ioctl(self.fd, SPI_IOC_MESSAGE(transfer_count), addressof(ioctl_arg))
return [transfer.to_read_bytes() for t in transfers if t.has_read_buf]
Another question :
how to set SPI configuration values like mode, clock speed, bits per word, LSB ... and so on.
Thanks in advance for your help.
I know you probably intend to learn how to use the ADC, an so this isn't really an answer to your question (I will use your very rich post for sure - thanks), but I'm aware of temperature sensors that already pack data in GPIO serial line, that are best suited for the raspberry.
You really have to read this awesome tutorial, if you haven't already.

Resources