Is it possible to Flash Two devices using 2 JTAG connected to single PC? - usb

I need to flash two devices using Xilinx impact command line. Both devices are equipped with JTAG and connected to different USB port of PC.
My flash script contains following code:
setmode -bscan
setcable -p auto
identify
assignfile -p 1 -file \test_AP_Ch1.bit`
program -p 1
quit
Is there any command through which I could specify the COM port to run this batch file.

The line setcable -p auto specifies the selected programmer 'cable'.
Digilent programmers can be addressed by IDs.
setmode -bs
setCable -port auto
setCable -target "digilent_plugin DEVICE=SN:210203356213 FREQUENCY=10000000"
identify
assignfile -p 1 -file myBitfile.bit
program -p 1
quit
You can see the serials when you connect one cable by another and look for new serials in iMAPCT (setup cable dialog box).

Related

send X11 window from local PC, with VNC over SSH to remote PC, without touching remote PC

Let's say I have two Linux PCs: LOCAL, where I sit physically, and REMOTE, that is connected to projector. So,
while sitting at my LOCAL computer, I want launch a graphical application, let's say google-chrome, and I want that to show up on the remote computer - but I don't want to physically go to remote computer and start 'vncviewer' every time I want to do this. I don't even want to go there to log in. How can I solve this problem?
In other words, I DO NOT want to do this every time:
Start x11vnc server on local pc:
LOCAL_PC ~$ x11vnc
# and do some graphical stuff, like:
LOCAL_PC ~$ firefox &
and then, physically go to the remote computer and start the vnc client:
REMOTE_PC ~$ vncviewer LOCAL_PC_IP
So i found the solution.
(to make sure this is the thing you are looking for: this solution will help you to open graphical applications on your computer and display it on remote computers monitor)
Short version
REMOTE_PC ~$ xhost +localhost
LOCAL_PC ~$ x11vnc -geometry 2560x1440 &
LOCAL_PC ~$ ssh UserName#REMOTE_PC_IP "export DISPLAY=:0.0 xeyes && cinnamon-screensaver-command -d && vncviewer LOCAL_PC_IP"
p.s. I don't know if the first line is even necessary
Long version :
REMOTE_PC -is the pc that is connected to projector
LOCAL_PC -is the pc that you sit on.
things to do on REMOTE_PC with IP - REMOTE_PC_IP
to enable localhost x controlling. PHYSICALLY go and type that, u need to do it once.
xhost +localhost
things to do on LOCAL_PC with IP - LOCAL_PC_IP
start vnc server
x11vnc -geometry 2560x1440
ssh to remote pc
ssh username#REMOTE_PC_IP
export display, unlock screen on that remote pc (like you entered password and logged in), start client and connect to server that was started on local PC.
export DISPLAY=:0.0 xeyes
cinnamon-screensaver-command -d
vncviewer LOCAL_PC_IP
p.s. instead of
cinnamon-screensaver-command, you might need to use gnome-screensaver-command

Serial port not working when using SOCAT in linux

I want to make a serial to ethernet and vice versa converter using Linux based board (Nano Pi board with Debian OS). For this I am using socat tool and making my board as TCP server. Using the below command in terminal I am Piping the serial port to TCP.
sudo socat TCP4-LISTEN:33888 /dev/ttyS1
The above code is working only when once the ttyS1 serial port was opened and closed with minicom with the default settings I saved before. I want to make it work by without opening minicom, so how can I set the serial parameters like baud rate, parity etc in the above command and how to make it to work automatically without opening minicom.
Please help me.
And thanks in advance.
I achieved the serial to ethernet conversion using below command with socat tool.
sudo socat TCP-L:33888 GOPEN:/dev/ttyS1,ispeed=4800,ospeed=4800,b4800,raw,echo=0

How to use Wireshark in live mode via SSHFS

I have a remote machine that I run experiments on. On this machine, I want to sniff the packets sent and received. On the machine in front of me, I want to open Wireshark and see the packets live.
The only way I have to access the remote machine is SSH.
What do I do?
Establish an SSH-mount using SSHFS.
Make sure that stdbuf is available (using homebrew on OS X or Cygwin on Windows).
Start capturing on the remote machine using
stdbuf -o0 sudo ibdump -s -o - > sniffer.pcap
Run Wireshark on the client
stdbuf -o0 tail -c +0 -F /sshfsmount/sniffer.pcap | ./Wireshark.exe -k -i -

How to SSH into a GCE Instance created from a custom image?

I'm having issues using ssh to log in to a VM created from a custom image.
I followed the steps for creating an image from an existing GCE instance.
I have successfully created the image, uploaded it to Google Cloud Storage and added it as an image to my project, yet when I try to connect to the new image, I get a "Connection Refused".
I can see other applications running on other ports for the new image, so it seems to be just ssh that is affected.
The steps I did are below:
...create an image from existing GCE instance (one I can log into fine via ssh)..then:
gcutil --project="river-ex-217" addimage example2 http://storage.googleapis.com/example-image/f41aca6887c339afb0.image.tar.gz
gcutil --project="river-ex-217" addinstance --image=example2 --machinetype=n1-standard-1 anothervm
gcutil --service_version="v1" --project="river-ex-217" ssh --zone="europe-west1-a" "anothervm"
Which outputs:
INFO: Running command line: ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /Users/mark1/.ssh/google_compute_engine -A -p 22 mark1#23.251.133.2 --
ssh: connect to host 23.251.133.2 port 22: Connection refused
I've tried deleting the sshKeys metadata as suggested in another SO answer, and reconnecting which did this:
INFO: Updated project with new ssh key. It can take several minutes for the instance to pick up the key.
INFO: Waiting 120 seconds before attempting to connect.
INFO: Running command line: ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /Users/mark1/.ssh/google_compute_engine -A -p 22 mark1#23.251.133.2 --
ssh: connect to host 23.251.133.2 port 22: Connection refused
I then try for the first instance in another zone, it works fine with the new key:
gcutil --service_version="v1" --project="river-ex-217" ssh --zone="europe-west1-b" "image1"
Both instances are running on the same "default" network with port 22 running, and ssh works for the first instance the image is created from.
I tried nc command from the other instance and my local machine, it shows no output:
nc 23.251.133.2 22
...whilst the original VM's ip shows this output:
nc 192.157.29.255 22
SSH-2.0-OpenSSH_6.0p1 Debian-4
I've tried remaking the image again and re-adding the instance, no difference.
I've tried logging in to the first instance, and switching user to one on that machine (which should be the same as the second machine?), and ssh from there.
WARNING: You don't have an ssh key for Google Compute Engine. Creating one now...
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
INFO: Updated project with new ssh key. It can take several minutes for the instance to pick up the key.
INFO: Waiting 300 seconds before attempting to connect.
INFO: Running command line: ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /home/mark/.ssh/google_compute_engine -A -p 22 mark#23.251.133.2 -- --zone=europe-west1-a
ssh: connect to host 23.251.133.2 port 22: Connection refused
I'm out of ideas, any help greatly appreciated :) The maddening thiing is I can see the new VM is live with the application ready, I just need to add a few files to it and set up some cronjobs. I guess I could do this pre-image making, but I would like to be able to log in at a later date and modify it, without needing to take 1hr to create images and launch new instances every time.
Yours faithfully,
Mark
This question appears to be about how to debug SSH connectivity problems with images, so here is my answer to that.
It appears that your instance may not be running the SSH server properly. There may be something amiss with the prepared image.
Possibly useful debugging questions to ask yourself:
Did you use gcimagebundle to bundle up the image or did it manually? Consider using the tool to make sure there isn't something you missed.
Did you change anything about the ssh server configuration before bundling the image?
When the instance is booting, check it's console output for ssh messages - it should mention regenerating the keys, starting sshd daemon and listening on port 22. If it does not or complains about something related to ssh, you should follow up on that.
You covered these, but for sake of completeness, these should also be checked:
Can you otherwise reach the VM after it comes up? Does it respond on webserver ports (if any) or respond to ping?
Double check that the network you VM is on allows SSH (port 22) access from the host you are connecting from.
You can compare your ssh setup to that of a working image:
Create a new disk (disk-mine-1) from your image.
Create a new disk (disk-upstream-1) from any working boot image, for example the debian wheezy one.
Attach both of these to a VM you can access (either on console or from cli).
SSH into the VM.
Mount both of the images (sudo mkdir /mnt/{mine,upstream} && sudo mount /dev/sdb1 /mnt/mine && sudo mount /dev/sdc1 /mnt/upstream). Note that whether your image is sdb or sdc depends on the order you attached the images!
Look for differences between the ssh config (diff -waur /mnt/{mine,upstream}/etc/ssh). There should not be any unless you specifically need them.
Also check if your image has proper /mnt/mine/etc/init.d/{ssh,generate-ssh-hostkeys} scripts. They should also be linked from /mnt/mine/etc/rc{S,2}.d (S10generate-ssh-hostkeys and S02ssh respectively).

how to find the IPs of all the devices connected to a particular server via telnet?

There are several computers connecting to one machine via telnet.. I want to find out which are all the systems/IPs which are connected to the machine via telnet... is it possible to find that out?
The netstat program will tell you what connections are active. You just need to grep the output for those established and connected to the telnet daemon.
sudo netstat --inet -p | grep "/telnetd" | grep ESTABLISHED
(or something very close to that -- I don't have a running telnetd service on my machine to verify the command -- you may have to look at the output of netstat directly and adjust the grep strings)