Check serial number of Harddrive or SSD in Citrix netscaler? - citrix

Looking for some CLI commands in Netscaler shell to find serial number of SSD/HDD.

Found it, should have done it in Q&A style.
> shell
# smartctl -a /dev/ad8
=== START OF INFORMATION SECTION ===
Device Model: STXXXXXXX0
Serial Number: ABCWHATEVER
LU WWN Device Id: 01010101010

Following Citrix ADC CLI command should also give you the serial number.
> show hardware
Platform: **
Manufactured on: **
CPU: **
Host Id: **
Serial no: **
Encoded serial no: **
Netscaler UUID: **

Related

Can I transmit serial data only using a data cable via Raspberry pi 0 w's USB port?

I have been recently trying to find out a way whether I can send serial data (large file like image data) only through the Rpi w 0's micro USB port using ttyGS0. But when I searched online I only found ways of setting up headless through serial and other stuff which was no what I wanted. But I did follow the tutorial half way
I went to '/boot/config.txt' and set 'dtoverlay=dwc2' at the end of the file after leaving a line
I went to '/boot/cmdline.txt' and did put 'modules-load=dwc2,g_serial' after 'rootwait' leaving a space
Thinking I could just use the /dev/ttyGS0 in my serial program on the Rpi and send the data the data was being sent but on my PC when I tried to access my Rpi which was on comport 12 it said port not found and couldn't open it. But it was showing up in the device manager as 'PI USB to Serial(COM12)'
Then I wondered whether it would be possible at all to access Rpi's com port this way.
If that's the case, I want to know if there is any other way to access the Rpi's USB port only using the USB cable
Note
I don't want to use Rpi's USB as a way of logging ie. 'headless setup'. I just want to receive serial data like an Arduino.
I don't want to use the GPIO pins (I tried) as they can only send limited characters at a time and I want to send an image file. Very quickly.
I don't have any serial converters at hand so i could route it to the arduino and use /dev/ttyUSB0
then read it on PC. I just only want to use the USB cable.
In case this info is required:-
my pc is a probook 6560b running windows 7
things i found while testing and stuff:-
I did do -lsusb command but i dint find my device on that list
I tried the 'ls /dev/ttyGS0' and i found '/dev/ttyGS0'
I checked many forums and some guys were asiking to use this command 'dmesg | grep tty'and show them the code . So i performed it i dont understand what alot in the piece of text means but if it would be helpfull i pasted it here:-
pi#aloypi:~ $ dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:6D:50:77 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=tty1 root=PARTUUID=4ab8bcad-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial
[ 0.001496] printk: console [tty1] enabled
[ 2.543414] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 2.561791] 20215040.serial: ttyS0 at MMIO 0x20215040 (irq = 53, base_baud = 50000000) is a 16550
[ 6.716694] systemd[1]: Created slice system-getty.slice.
i also tried this one 'dmesg | grep dwc2' out of curiosity and got this but i cant say anything judging it so ya
pi#aloypi:~ $ dmesg | grep dwc2
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:6D:50:77 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=tty1 root=PARTUUID=4ab8bcad-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial
[ 2.379190] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 2.386185] dwc_otg: FIQ enabled
[ 2.386205] dwc_otg: NAK holdoff enabled
[ 2.386219] dwc_otg: FIQ split-transaction FSM enabled
[ 2.386245] Module dwc_common_port init
[ 2.968203] modules-load=dwc2,g_serial
[ 8.344134] dwc2 20980000.usb: supply vusb_d not found, using dummy regulator
[ 8.367130] dwc2 20980000.usb: supply vusb_a not found, using dummy regulator
[ 8.626751] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 8.647109] dwc2 20980000.usb: DWC OTG Controller
[ 8.653810] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 8.726672] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 8.787097] usb usb1: Manufacturer: Linux 5.10.17+ dwc2_hsotg
[ 9.371395] dwc2 20980000.usb: bound driver g_serial
[ 194.158373] dwc2 20980000.usb: new device is high-speed
[ 194.189677] dwc2 20980000.usb: new device is high-speed
[ 194.225164] dwc2 20980000.usb: new address 3
Ok looks like i made some progress
till now I did this
I went to '/boot/config.txt' and set 'dtoverlay=dwc2' at the end of the file after leaving a line
I went to '/boot/cmdline.txt' and did put 'modules-load=dwc2,g_serial' after 'rootwait' leaving a space
I did this 'sudo nano /etc/rc.local' and placed 'modeprobe g_serial use_acm=0' before 'exit 0'
Then i performed this command 'sudo systemctl stop getty#ttyGS0.service'
and then this 'sudo systemctl disable getty#ttyGS0.service'
(i think disabling getty#ttyGS0.service and puting 'modeprobe g_serial use_acm=0' in the folder metioned above allowed rpi and pc to comunicate but then again i can be wrong )
then perfored a 'sudo reboot'
this seemed to solve my problem
but i have one more problem now
whatever is sent from the rpi i can only recieve in the coolterm serial port reading software
i cant seem to use read the port from processing for some reason
(im using processing to later read the image file being sent)
here is my current serial reading program in processing
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
void setup()
{
myPort = new Serial(this, "COM13", 115200);
}
void draw()
{
if ( myPort.available() > 0)
{ // If data is available,
val = myPort.readStringUntil('\n'); // read it and store it in val
}
if (val!=null)
{
println(val); //print it out in the console
}
}
i kinda am stuck here :P
EDIT
welp nevermind i solved it
i finally finally got it working yaaaaaaaayyy
OK now remember all who seek for the answer when using /dev/ttyGS0 it uses the CTS and RTS protocall
(now idk if it can be disabled but please lemme know you guys)
Its like the pi asks your pc wether it is cleared to send the data and when the pc says yeah ok send the data the pi sends it
so whenever your using this method please enable rts or cts
this is what i used in processing to recieve the data
import processing.serial.*;
Serial myPort;
void setup()
{
//remember to set the COM port to which your pi is set
size(200, 200);
myPort = new Serial(this, "COM13", 115200);
}
void draw()
{
if ( myPort.available() > 0)
{
if(myPort.getCTS()==true){
myPort.setRTS(true);
print(myPort.read());
}
}
}
i hope this is of loadsa help to you guys but if there is some correction needed please lemme know yall:D
thanks

Raspberry PI 4 + Huawei E3372 - Send AT commands

I'm trying to send AT commands to a Huawei E3372 USB Dongle but I haven't figured out how to mount correctly.
If I do lsusb, I get the following:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 001 Device 003: ID 03f0:034a HP, Inc Elite Keyboard
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The dongle is listed, I can also access it's configuration screen on 192.168.1.1 and I can access internet.
I have tried creating the config file:
sudo nano /etc/usb_modeswitch.d/12d1:14db
and entered the following configuration
TargetVendor=0x12d1
TargetProduct=0x14db
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NoDriverLoading=1
I have tried various configurations found on the web but none seems to work.
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyAMA0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyprintk
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
No more luck with dmesg | grep ttyUSB that returns nothing (same for USB0, USB1,...)
It's probably something wrong in the config file but I don't see exactly what needs to be done.
Any idea ?
Thanks!
You attach wrong lsusb output. The dongle is not listed.
Perhaps the device code 14db and accessible 192.168.1.1 looks like your modem is switched to newest mode where the dongle looks like router. If you would like to send AT command then you must change mode to serial. First of all try it through:
/etc/usb_modeswitch.conf
The last part of the file contain your desired option:
HuaweiAltModeGlobal=0
Notice the comment above this option:
...you can globally set an alternative method here which provides a
different mode: either plain serial PPP...
Just try to change number. There should be around 6 modes and one of them will switch your dongle to serial mode.
Best luck.

Why might `i2c_smbus_write_byte_data` be returning "Operation not permitted" on uClinux 2.4?

I am writing a C program with the aim of configuring a peripheral device (the CS5368 ADC) via the I2C interface of a Dante Brooklyn II, a board based on a Microblaze soft-core processor running uClinux 2.4.
I have implemented the configuration following the Dante OEM docs for guidance, however when running my program I am encountering an "Operation not permitted" (EPERM) error when attempting to write data to I2C using i2c_smbus_write_byte_data.
Here is the section of code containing the culprit call to i2c_smbus_write_byte_data:
// Set ADC I2S to "Slave mode all speeds".
printf("Set the CS5368 I2S mode to slave\n");
unsigned char adc_dif = 0x01; // I2S mode
unsigned char adc_mode = 0x03; // Slave mode all speeds
unsigned char data = 0x90 | (adc_dif << 2) | adc_mode;
result = i2c_smbus_write_byte_data(i2c_fd, CS5368_GCTL_MDE, data);
if (result < 0) {
perror("Failed to write to the 'Global Mode Control' register");
return -1;
}
Here is the code within context of the full source of the small program. The program begins by resetting the CS5368 via a GPIO pin before doing the configuration via I2C.
EPERM is returned whether or not I have the CS5368 wired up. I've been able to successfully configure the CS5368 using the I2C interface of an Arduino Uno, so the issue does not appear to be related to the CS5368.
To run the program I login to the board via telnet as root, so I doubt the error has anything to do with user permissions.
The OEM docs state:
The Brooklyn II module can operate as an I2C controller running at
100Khz and using 7 bit addressing mode. It supports multi-master
operation. I2C devices can be accessed from user application running
on the Brooklyn II module. The interface supports the SMBus (System
Management Bus) protocol, which is a subset from the I2C protocol.
It goes on to list the supported i2c_smbus_* functions including i2c_smbus_write_byte_data, so the issue does not appear to be related to lack of support for SMBus or I2C.
I came across a related issue where a user was getting an EPERM error code when attempting to use the I2C write API, however the solution appears to have been to use the i2c_smbus_* API instead which I am already doing.
Any advice on what could be causing this error code to be returned or how to debug the issue further would be greatly appreciated!
Edit: In case it helps, here is the full output, starting from logging onto the board via telnet after having moved the exe to /tmp via ftp:
$ telnet 169.254.72.245
Trying 169.254.72.245...
Connected to 169.254.72.245.
Escape character is '^]'.
login: root
Password:
BusyBox v1.23.2 (2018-05-31 11:33:18 AEST) hush - the humble shell
/ # cd /tmp
/var/tmp # ./cs5368-i2c-config
Open GPIO device
Set GPIO tristate outputs
Set GPIO pins low
Sleep for 10 secs
Set GPIO pins high
Close GPIO file descriptor
Searching for I2C device
Opening /dev/i2c-0
Setting I2C_SLAVE 4c...
I2C Interface found: /dev/i2c-0
Set the CS5368 as the slave
Set the CS5368 I2S mode to slave
Failed to write to the 'Global Mode Control' register: Operation not permitted

My usb HSM came initialized and now I do not know how to use it

I am new to HSM and seems like working with pkcs11 is the most popular approach.
I plugged in a USB HSM and when I listed it, it shows it was already initialized. How can I log into it without knowing the user and SO pins ?
Slot 18446744073709551610
Slot info:
Description: Virtual hotplug slot
Manufacturer ID: OpenSC (www.opensc-project.org)
Hardware version: 0.0
Firmware version: 0.0
Token present: no
Slot 1
Slot info:
Description: Identiv uTrust 3512 SAM slot Token [CCID Interface] (55511725602
Manufacturer ID: OpenSC (www.opensc-project.org)
Hardware version: 0.0
Firmware version: 0.0
Token present: yes
Token info:
Manufacturer ID: www.CardContact.de
Model: PKCS#15 emulated
Hardware version: 24.13
Firmware version: 2.5
Serial number: DECC0300697
Initialized: yes
User PIN init.: yes
Label: SmartCard-HSM (UserPIN)
Can I get help for this ?
You need to contact your HSM supplier and ask him to provide you PIN values.

Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

I'm a new user on RTnet and try to make Rtnet work on Freescale Sabre Lite iMX6Q board. But I got an issue, RTnet can't use rt_fec.ko module driver to register rt_eth0 even though non real time driver is disable.
I'm using:
Linux kernel 3.0.43 download from Xenomai git://git.xenomai.org/ipipe-gch.git/?h=ipipe-3.0-imx6q
Xenomai 2.6 download from git.xenomai.org/xenomai-2.6.git/
RTnet 0.9.13 download from rtnet.org/download.html
Please see my kernel configuration and boot log in attached link.
Xenomai is loaded:
"*I-pipe: Domain Xenomai registered.
Xenomai: hal/arm started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.
Xenomai: debug mode enabled.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.* "
And FEC ethernet driver (non real-time driver) is loaded when kernel is booting
*"FEC Ethernet Driver
fec_enet_mii_bus: probed "*
Xenomai is built following install guideline for ARM platform from Xenomai:
http://xenomai.org/installing-xenomai-2-x/
RTnet is built by below command, because SABRE Lite use FEC ethernet card with Micrel KSZ9021 Gigabit chip so I put "--enable-fec" in configure command to build real-time driver for FEC ethernet card:
"./configure --host=armv7l-timesys-linux-gnueabi --with-rtext-config=/home/sonnguyen/rtnet-xenomai-rootfs/usr/xenomai/bin/xeno-config --with-linux=/home/sonnguyen/build/rtnet-xenomai-ipipe-imx6q --enable-rtcfg-dbg --enable-rtwlan --enable-net-routing --enable-router --enable-nomac --enable-rtcap --enable-proxy --enable-checks --enable-fec "
Then
"make DESTDIR=/home/sonnguyen/rtnet-xenomai-rootfs install"
I also changed RT_DRIVER from default value to "rt_fec" in rtnet.conf.
After kernel is booted, I ran "./rtnet start" and got this:
"RTnet: initialising real-time networking
RT FEC Ethernet Driver
./rtnet: line 385: can't create /sys/bus/pci/drivers/rt_fec/bind: nonexistent directory
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device "
Then I tried:
"# lspci
lspci: /sys/bus/pci/devices: No such file or directory
ls /sys/bus/
ac97 hid mdio_bus platform sdio spi
event_source i2c mmc scsi serio usb "
No pci directory under /sys/bus/. Then I thought because the script can't find the ethernet physical bus, it can't register rteth0.
Then I looked into rtnet script and did some minor change. In the script it requires physical ethernet device ID (mentioned in REBIND_RT_NICS), so I tried to find out what it is and got this when make eth0 up with non real-time driver:
"eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=1:06, irq=-1)
PHY: 1:06 - Link is Up - 1000/Full "
I think 1:06 is my physical bus ID, then I change the code in rtnet from:
for dev in $REBIND_RT_NICS; do
if [ -d /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
echo $dev > /sys/bus/pci/drivers/$RT_DRIVER/bind
done
To
echo 1:06 > /sys/bus/mdio_bus/drivers/Micrel\ KSZ9021\ Gigabit\ PHY/unbind
echo 1:06 > /sys/bus/platform/drivers/rt_fec/bind
And I tried again with "./rtnet start", this time I got this:
RTnet: initialising real-time networking
RT FEC Ethernet Driver
sh: write error: No such device
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device
But it still said "No such device"
This is lsmod after I ran ./rtnet start
lsmod
Module Size Used by Not tainted
tdma 25691 0
rtmac 9724 1 tdma
rtcfg 58071 0
rtcap 7151 0
rt_loopback 1279 2
rtpacket 6365 0
rtudp 10738 0
rt_fec 12742 0
rtipv4 29987 2 rtcfg,rtudp
rtnet 40746 9 tdma,rtmac,rtcfg,rtcap,rt_loopback,rtpacket,rtudp,rt_fec,rtipv4
./rtifconfig
rtlo Medium: Local Loopback
IP address: 127.0.0.1
UP LOOPBACK RUNNING MTU: 1500
Only rtlo is registered.
I also tried with kernel linux without non real-time FEC driver (please refer in another config file in attached Skydrive link), but still the same issue happened.
Do you have any idea how to solve this issue? I did many search but still can not figure out how to fix it.
Because I can't attach the files to my post, so I put all of my configuration files in the link below:
https://onedrive.live.com/redir?resid=162EDF85AEBD2EFE!717&authkey=!AJ1Fjd_XiohUwes&ithint=file%2czip
Best Regards,
Nguyen Hung Son