MAC address of TBS6905 DVB-S2 Quad Tuner PCIe Card - c

I have TBS6905 DVB-S2 PCIe card and its configured in Ubuntu 14.
And I have to find MAC address of all adapters because my application will do Blind Scan for all four adapters at the same time.
And index of these adapters will change after reboot.
So I have to find MAC address and set static start and end frequency to particular adapter device using C language.
What I tried:
- I checked dmesg but I did get MAC address(while I have also Prof 7500 DVB-S2, in that dvb card I can find MAC address using dmesg).
- And I also checked udevadm command, but no luck yet.
Thank you.

https://unix.stackexchange.com/questions/147278/how-does-ubuntu-14-04-achieve-persistent-eth-interfaces
The persistent eth interface rule for udev, you can probably grab from another version or distro.
The MAC address is visible for shell scripts if you run commands like ifconfig.

We can give static Index to particular DVB device using udev rules.
Example1 and
Example2

Related

Beaglebone Black won't show-up as /dev/ttyUSB

I am trying to learn Linux by following instructions in "Mastering Embedded Linux Programming" by Chris Simmonds. By following the book and with some help from Stack_Overflow_1, i was able to build the MLO and u-boot.img.
However, when i connect USB cable to my PC and execute the ls /dev/tty* command, i cannot find any device with /dev/ttyUSB. All i can see are devices with /dev/tty0-63, /dev/ttyS0-31 and one /dev/ttyprintk.
Also, when i press down the S2 button and connect the USB cable, i can only see the power led glowing and nothing else.
I have properly built the u-boot (three attempts to get it right).
Also, as per the instructions in the book, i am only testing the u-boot stuff and yet to reach the kernal part.
If i remove the sd card and connect the USB, im an able to talk to my BBB over ssh (192.168.7.2).
How to i get the u-boot to work? Thank you!
If you don't have one yet, I'd recommend to get a USB-to-serial device (3.3V Vref). You connect it to the debug UART (J1) which is located next to the P9 side. Nowadays those are very cheap and can cost below 1$. Ones that feature a genuine FTDI part will be 5-10$ at least.
The serial port you are referencing is only available once the device has passed through U-Boot, booted the kernel and finally userspace has set up the communications.
Especially when working with U-Boot and the Kernel, low level UART access is crucial.
As a further note, could it be that the Book refers to the (white) original Beaglebone? That has a FTDI USB-to-UART chip on board and will allow you even U-Boot access. You can do the same things if you have the above mentioned USB device.
https://groups.google.com/g/beagleboard/c/eNDjK05spY8/m/GPvhcP52BAAJ shows that one needs to hold the space key to enter u-boot.
Also, the info. here might be more up to date compared to the book.
https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black
There is no way to copy and paste everything from the eewiki. I just left you the link. Enjoy!

Search device using MAC address

I want to check presence of a device in network. The IP address of device keeps on changing. Is there any way I can search device through MAC address.
Through ARP I can ping the device but as IP keep on changing, I am thinking get device through MAC address.
Is there any mechanism to search device through MAC.
On Linux, you can use a tool called arp-scan.
Not sure what you tried so far.
arp -s < IP address > < MAC address >
There is an interesting article published by Microsoft
https://technet.microsoft.com/en-us/library/cc961394.aspx

Serial Port Connection Between Host and Guest with Virtualbox

I'm trying to learn how to write C code that will read from the serial port in Linux. I've found what seems to be a good tutorial here.
I want to be able to test this code, so I think I need either a serial port, or a way to write to the serial port while the code from above is reading.
I'm running Ubuntu 10.04 as a virtual machine on my Mac using virtualbox. My idea was to set up a virtual serial connection and write from the host to the guest. Hopefully something as simple as cat "Hello World" > /tmp/fake_serial in a host terminal, and for that to be read by the program in the link above.
Is this possible? I've tried adding a serial port using virtual box and when I try to do the above command I get an error saying I can't write to a socket.
The second option I thought of was using something like minicom inside the guest OS, to connect to say /dev/ttyS1 and write messages for my code to read at the same time. Again, assuming that the baud rates and other settings are OK, would this be possible?
I don't have a lot of experience working with serial ports, so I'd appreciate any suggestions about the best way to do this. Thanks in advance.
So to get this working I just added another Ubuntu VM on VirtualBox, and connected the two together via a virtual serial port. My main, original VM, which I use for a lot of developing will be referred to as VM1. The new VM, with a small hardrive that will only be used for sending messages to VM1 will be called VM2. These are both Ubuntu 10.04 VMs.
In VirtualBox go to Settings for VM1, go to ports, and change the settings as follows:
Now go to VM2, and select settings, ports, then change as follows:
Now first you need to start VM1. When that's booted then boot VM2. Now you can open a terminal in VM1, and type screen /dev/ttyS0 38400 (you may need to run sudo apt-get install screen before this works). Then go to VM2, open a terminal, and type echo "Hello" > /dev/ttyS0.
You should see Hello appear in the terminal open in VM1. When you're done running screen press ctrl-a k to kill it, otherwise if you try to do other stuff with the serial port you may get an error message saying that the port is busy.
When I had to do some serial port testing from my real to virtual machine I ended up doing a "loop back" type testing. I took two USB-Serial converters and a RS232 F-F adaptor and connected my machine to itself. Then in VirtualBox under Settings->USB you can route one of the two USB-Serial converters to be "owned" by your VirtualBox.
Once you plug in the converters one will register with the Mac and one with the Ubuntu "computer" then you can do serial communication as normal between the two machines.
You may also be able to emulate a virtual serial port using a pty ("pseudo-teletype" device), but I'm not positive on that one since I believe the ability to do that was locked down in newer kernels.
I ran into a similar situation running a QNX guest using VirtualBox 5.0.10 on an Ubuntu 14.04 host.
My solution seems general enough to apply to the above-mentioned case.
I configured the guest VM in the same way that Kells1986 setup his VM1:
Under the "Serial Ports"/"Port1" tab:
check "Enable Serial Port"
set "Port Number" to "COM1"
set "IRQ" to "4"
set "I/O Port" to "0x3F8"
set "Port Mode" to "Host Pipe"
uncheck "Connect to existing pipe/socket"
set "Path/Address" to an accessible file-system path (e.g. "/home/safayet/vmSerialPipe")
According to the VirtualBox manual:
You can tell VirtualBox to connect the virtual serial port to a
software pipe on the host. ... On a Mac, Linux or Solaris host, a local domain socket is used ... On Linux there are various tools which can connect to a local domain socket or create one in server mode. The most flexible tool is socat and is available as part of many distributions.
A domain socket is an IPC mechanism on UNIX systems similar to a pipe.
I connected to the "pipe" end of the virtual serial port on the Ubuntu host using the socat command:
socat - UNIX-CONNECT:/home/safayet/vmSerialPipe

Raspberry Pi usb redirect issue

Okay I am going to try and be as discriptive as possible here to get this problem solved. I work at a company that makes BIG gear boxes and we have computers that run our Mills/Laths. These computers are currently FIT-PCs running XP. These computers are used to control the laths/mills via a usb to serial converter (PL2303_Prolific usb to serial converter). When it is plugged into an xp machine it is recognized as a com port. SO these machines are very old and are fail left and right, I intend to replace them with a raspberry pi running xfreerdp but I can't seem to get the usb serial device to be redirected to the virtual machine it is remoting into. Has anyone ran into this/know a fix for it? Please ask me questions if you are unsure of something because I am completely stuck here. TLDR Using raspberry pis as thin clients need to push a usb 2 serial cable through to the virtual xp machine
Unfortunately there are known issues with USB on Raspberry Pi. They're aware of the issue and working on it, but it is as of yet unresolved.
The USB Redux thread was created to capture the state of the work as well as the current list of work-arounds. The USB/serial converters are broken is a related thread.
There is hope, however. First, they are working actively to fix it, so I suspect it's just a matter of time. Second, there are a few things you can try.
There's a config file in
/boot/cmdline.txt where you can try adding a few entries. One that appears quite effective is dwc_otg.speed=1 and dwc_otg.fiq_fix_enable=1 (but they didn't help me). See this page for some examples.
Update the kernel (search for rpi-update) to at least #348 (use uname -a to determine the kernel level)
Good luck.
Update (Mar 13 2013). There appears to be a fix for the majority of USB issues as of kernel #389. Use rpi-update to update.

How to Determine IP and MAC address for netsnmp agent?

I am using Debian 6.0 and net-snmp 5.4.3. I have a question relating to capturing IP address and MAC address for ethernet interfaces exist on the system. In my SNMP agent, I have to figure out how many system ethernet interfaces are exist and update their IP and MAC address in a table. I have looked at pre installed mibs and found that IP-MIB contains a table for system ethernet IP addresses but I couldn't find the source to check how it is implemented. Could you please suggest me how can I implement this functionality or where I can find some further infromation?
Thanks,
Ravi
Someone may suggest a better way, but if not here's a solution of last resort. You can call out to ifconfig to get the data as text and then parse the results.

Resources