I have a device using an Atmel processor running under Linux. To this device I want to connect a remote device using a AT91SAM7 processor. This remote device is configured to do a pseudo-serial over the USB, under Windows this works fine and shows up as "AT91 USB to Serial Converter (COM3)".
Under Linux the device appears in the /dev as following:
crw-rw---- 1 root root 253, 7 Aug 30 10:52 /dev/usbdev2.2_ep00
crw-rw---- 1 root root 253, 5 Aug 30 10:52 /dev/usbdev2.2_ep01
crw-rw---- 1 root root 253, 6 Aug 30 10:52 /dev/usbdev2.2_ep82
crw-rw---- 1 root root 253, 4 Aug 30 10:52 /dev/usbdev2.2_ep83
What must I do in order to communicate with the device? Some driver to bind into the kernel? Or does a loadable driver (.ko) exist?
Based on what yo wrote, the embedded board with the AT91SAM7 processor is correctly configured, since it works when you connect it to a windows host.
If it does not work under linux, probably it is due to the fact that it does not recognize the vendorid:productid values.
On the linux host check the output of lsusb:
ottavio#ottavio:~$ lsusb
Bus 004 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
ottavio#ottavio:~$
in this case, that a USB<->RS232 converter I have on my computer. You should have a line related to your board when you plug it.
Now, depending on your system you may need to user usbserial or ftdi_sio. So try first to load usbserial
modprobe usbserial vendor=0x067b product=0x2303
if this does not work try loading ftdi_sio
modprobe ftdi_sio vendor=0x067b product=0x2303
Pay attatention that if the modules are already loaded you need to rmmod them. Finally, in my example vendrid is 0x067b and product is 0x2303, you'll need to use the correct values.
Related
I have a DHCP Server working on PFSense 2.4.4. While it works perfectly with RHEL 7/CentOS 7 machines, it doesn't work on RHEL6/CentOS 6 (both with fixed IP or dynamic range).
This is what DHCP Server Logs show (IP and MAC are obfuscated):
DHCPREQUEST for xxx.xx.255.15 from aa:bb:cc:dd:ee:ff via bge0
DHCPACK on xxx.xx.255.15 to aa:bb:cc:dd:ee:ff via bge0
send_packet: Host is down
dhcp.c:3976: Failed to send 318 byte long packet over fallback interface.
Here is what service network restart shows in CentOS 6:
Restarting network service
And here is what /var/log/messages shows (xxx.xxx.255.3 is the Pfsense DHCP Server address; xxx.xxx.255.1 is the default route; xxx.xxx.255.15 is the supposed address that should be bound to the machine):
Messages file
Lastly, here is my PFSense server info if it helps:
BIOS Vendor: Dell Inc.
Version: 2.6.0
Release Date: Tue Oct 31 2017
Version 2.4.4-RELEASE (amd64)
built on Thu Sep 20 09:03:12 EDT 2018
FreeBSD 11.2-RELEASE-p3
CPU Type Intel(R) Xeon(R) CPU E5-2620 v3 # 2.40GHz
24 CPUs: 2 package(s) x 6 core(s) x 2 hardware threads
AES-NI CPU Crypto: Yes (inactive)
I've tried rebooting those Centos 6 machines, rebooting PFSense, and I made sure the machines and PFSense packages are all updated. Nothing works.
Any help is appreciated.
After struggling with this I found this in DHCP Server option in PfSense:
Additional BOOTP/DHCP Options
I configured it like this:
Additional config
Turns out DHCP wasn't providing the Subnet Mask to CentOS 6 instances and with this option enabled, the mask is appended to the lease file.
I have an LG B470 flip phone. I want to be able to send and receive text messages from my Mac Laptop running OS X 10.10.5.
I have the phone plugged in via USB. I can send SMS messages using the minicom terminal. However, attempting to list or read SMS messages from the phone/modem causes the modem to stop responding:
AT
OK
ATI
Manufacturer: LG ELECTRONICS
Model: LGB470
Revision: LGB470-QSC6270-V10c-JAN-11-2016-ATT-US 1 [JAN 11 2016 22:00:00]
SVN: 01
IMEI: 359926084167819
+GCAP: +CGSM,+DS,+ES
OK
AT+CPMS?
+CPMS: "ME",15,500,"ME",15,500,"SM",0,30
OK
AT+CMGF=1
OK
AT+CMGS="+12146168895"
> Hello World.
+CMGS: 169
OK
AT+CMGL="ALL"
I get no response and can no longer communicate at all. Typing is not echoed back and if I turn local echoing on and attempt to send the AT command I get no response. The only way to get the modem to respond is by restarting the phone (unplugging and plugging back in the phone's USB, etc. does not help).
The same thing happens after AT+CMGR commands.
Question
Why does the phone/modem stop responding after AT+CMGL and AT+CMGR commands? How can I fix this so I can get incoming SMS messages from my phone to my mac? Any tips on how to debug?
Setup
I did not install any drivers. When I plugged my phone into my mac via USB it was recognized automatically. It is shown as an internet modem in System Preferences->Network. Some character devices were also created:
$ ll /dev/tty.*
crw-rw-rw- 1 root wheel 18, 4 Apr 20 13:27 /dev/tty.BIGJAMBOXbyJawbone-SPPD
crw-rw-rw- 1 root wheel 18, 2 Apr 20 13:27 /dev/tty.Bluetooth-Incoming-Port
crw-rw-rw- 1 root wheel 18, 0 Apr 20 13:27 /dev/tty.Bluetooth-Modem
crw-rw-rw- 1 root wheel 18, 6 Apr 20 13:27 /dev/tty.LGB470-LGPCSuite
crw-rw-rw- 1 root wheel 18, 12 Apr 20 13:46 /dev/tty.lgusbmodem1411
crw-rw-rw- 1 root wheel 18, 14 Apr 20 13:46 /dev/tty.lgusbserial1411
tty.lgusbmodem1411 (lg usb modem 1411) and tty.lgusbserial1411 (lg usb serial 1411) disappear and reappear when I unplug and plug in the phone's USB. tty.LGB470-LGPCSuite is always there and seems to reference the LG PC Suite software which is not compatible with my phone.
I can also connect to it via Bluetooth and transfer files via the "Bluetooth File Exchange" app.
minirc.dfl:
pu port /dev/tty.lgusbmodem1411
pu lock /usr/local/Cellar/minicom/2.7.1/var
pu escape-key Escape (Meta)
Additional Info
As reported by the ATI command, my LGB470 phone uses the Qualcomm QSC6270 "HEDGE (HSDPA/WCDMA and GSM/GPRS/EDGE)" chipset. I can not find documentation on the GSM modem/AT commands, however.
Atom is able to open a project, and to show the whole tree of the project on the left side, a really nice feature.
Now I'm using SSH on Host OS to access a Guest OS (say Red Hat Enterprise Linux, RHEL) on Virtualbox, is there a way of Atom located in Host OS to open a project located on RHEL?
Well yes there is!
You just need to configure sshfs, optionally with autofs. Then you can access the files as if they are stored locally. I've used this with Atom and it works seamlessly.
Instructions for Ubuntu
Install sshfs
$ sudo apt-get install sshfs
Mount the remote directory on a local mountpoint
$ sshfs [user#]host:[dir] mountpoint
Combining it with autofs
The following link has instructions for a setup using autofs.
Note: This requires you to setup SSH for the root user.
http://www.mccambridge.org/blog/2007/05/totally-seamless-sshfs-under-linux-using-fuse-and-autofs/
Additionally to that post, I've added some tricks for an even more seamless experience.
Enhance performance
I've noticed a significant performance boost by adding this SSH config to /root/.ssh/config:
Ciphers arcfour
Compression no
Note: This does make the connection less secure.
Make it appear as a disk
If you set the mount point to a directory in /media, the mount point will show up as a disk in your file browser. For example /media/sshfs.
I would recommend the Remote sync plugin for this. I have a python environment set up on a linux box and i connect to it from my PC.
It allows me to upload changes automatically when i save a file and also define files to be monitored for changes.
Not 100% what you're looking for, but there's the Remote-Edit package: https://atom.io/packages/remote-edit
This will allow you to define the connection parameters for the server, and will then allow you to browse and edit the files found on the server.
Complement to Remco's sshfs answer above:
If you use different users in the client and server hosts, consider using the 'idmap' option of sshfs.
I use different users in my working host and in the development or testing VMs.
Example:
using option '-o idmap=user' will automatically translate UID/GID of the remote host to the UID/GID of the connecting user in the local host
Files owned by remote user (devuser) in remote host (devhost1) will appear as belonging to the connecting user (locuser) in local host (clienthost)
locuser#clienthost:~$ sshfs devuser#devhost1:/var/www ~/dev/www -o idmap=user
locuser#clienthost:~$ ls -lR ~/dev/www
(...)
-rw-rw-r-- 1 locuser locuser 269 abr 1 11:37 index.html
-rw-rw-r-- 1 locuser locuser 249 abr 3 03:59 page1.html
-rw-rw-r-- 1 locuser locuser 1118 abr 2 15:07 page2.html
-rw-rw-r-- 1 locuser locuser 847 abr 3 03:20 page3.html
(...)
The mapping can also be made explicit (userx <-> usery). For more details see man sshfs
I am writing this answer because none of the other answers worked for me.
Mounting as a directory & browsing with atom (#Remco Haszing answer) was a brilliant one.
but in my case, atom wants to index all of the remote project & its a heavy one. and it gets not responding.
using remote-sync package was good when you working locally then want to upload the files to server.
Actually the remote-edit is the package meant to do this job. (editing files remotely on ssh)
the problem with this is, it has been abandon.
These help me as its replacements:
https://atom.io/packages/remote-edit-ni
https://atom.io/packages/remote-editor
I'm using Docker for Windows( I am not using Docker Toolbox that use a VM) but I cannot see my container from another machine on local network. In my host everything is perfect and runs well,however, I want that other people use my container.
Despite being posting the same question in Docker's Forum , The answer was not show it. Plus, I have been looking for here but the solutions found it are about setting up the bridge option in the virtual machine , and as I said before, I am using Docker for windows that no use Virtual machine.
Docker version Command
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
789d7bf48025 gogs/gogs "docker/start.sh /bin" 5 days ago Up 42 minutes 0.0.0.0:10022->22/tcp, 0.0.0.0:5656->3000/tcp gogs
7fa7978996b8 mysql:5.7.14 "docker-entrypoint.sh" 5 days ago Up 56 minutes 0.0.0.0:8989->3306/tcp mysql
The container I want to use is gogs that is working in the port 5656.
When I use localhost:5656 y 127.0.0.1:5656 work properly, but when I use My local network IP (192.168.0.127) from other machine the container is unreachable.
Thanks in advance.
Solution:
When I installed Docker for Windows, it creates a network called vEthernet (DockerNAT) (Usually with the ip 10.0.75.1)
My local machine had a network called local area connection with the ip 192.168.0.172(With this ip I was trying to access from other PCs).
So far, My local Machine had Two networks Conections so that I went to Control panel > NetWork and Sharing center > Change Adapter Settings I selected the two networks and I right-click selected Add to bridge. That create a Third network called Ethernet.
At this point, I didnt know what was the Ip of Ethernet network, so I executed ipconfig command that show me the ip 192.168.0.17(The settings of local area connection and vEthernet (DockerNAT) disappeared and the ips 10.0.75.1 and 192.168.0.172 stop working).
With this new ip (192.168.0.17) I tried from other machine in the network and finally I could access to the container(192.168.0.17:5656).
In Hyper-V settings, putting "Docker NAT" network in "external" mode worked for me. (I can access to my container on my local network with my host's IP)
I have configured one OpenWrt (lets call it child) to boot from sd card which has the firmware and software re-imaged from another OpenWrt (lets call it maker) as per following: http://labs.mediatek.com/forums/posts/list/3619.page#p7191.
Everything works fine except for the issue where wlan interface of child and maker are showing the same MAC address, the one of maker. Due to this I can connect to only one of them if they both are in AP mode.
I have tried giving 'macaddr' option in 'wifi-device', 'wifi-iface' but nothing works. I have also tried setting hardware address using command:
ifconfig ra0 hw ether 'XX:XX:XX:XX:XX:XX'
but this gives me error
ifconfig: SIOCSIFHWADDR: Operation not supported
I can see that the mac address is picked from
/sys/class/net/ra0/address
where ra0 is the interface name but its a read only file and is not there on sd card (atleast with the given path)
The mac address of the parent has to be on the sd card but can't find it using grep atleast.
So I would appreciate any help here, either in changing the address on sd card post imaging or override it in system startup.
Thanks
You can take a look on the calibration data in the "art" partition.If your MAC address is stored in it then you can change it.
root#OpenWrt:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00fc0000 00010000 "firmware"
mtd2: 00120000 00010000 "kernel"
mtd3: 00ea0000 00010000 "rootfs"
mtd4: 00c60000 00010000 "rootfs_data"
mtd5: 00010000 00010000 "art"
So my one is /dev/mtd5 . Now I will check the calibration data inside
cat /dev/mtd5 > art.img
hexdump art.img
My wifi MAC address is 04:F0:21:07:7C:EC .After running hexdump art.img it shows
0001000 0202 04f0 2107 7cec 0020 2020 0030 6530
I need to use a software application to modify art.img ,change "04f0 2107 7cec" to new MAC address
Then the final step is :copy the edited art.img to /dev/mtd5
cat art.img > /dev/mtd5
Thanks for the help.
It seems that for mediatek linkit 7688, the MAC is stored in /dev/mtd2. Ideally this is a ROM partition and should not be affected on booting from SD card or raw flash.
But I found that upon boot it caches the same under /lib/firmware/mt7628.eeprom file which also gets copied on preparing sd card from a linkit.
So when I boot second linkit from sd card it considers the first linkit cache as its own /dev/mtd2 cache and thus the problem.
To solve this, after the sd card image is prepared, remove the file /mnt/upper/lib/firmware/mt7628.eeprom and make a symlink to /overlay-boot/upper/lib/firmware/mt7628.eeprom where /mnt is sd card mount location and overlay-boot is raw flash mount location