EXT-SBC-i.MX51-COMM/DISP: Unterschied zwischen den Versionen
en>Peter K (1 Version importiert) |
Peter (Diskussion | Beiträge) K (1 Version importiert) |
(kein Unterschied)
|
Aktuelle Version vom 31. Oktober 2023, 09:03 Uhr
The EXT-SBC-i.MX51-DISP extension board features
- Display connectors for 1 WVGA TFT from Emerging Displays and 1 LVDS XGA TFT from Toshiba
- Camera connector for OV2655 UXGA camera from OmniVision (HW Rev. 1.0)
- Camera connector for Bluetechnix Image Sensor Module (HW Rev. 1.1 and above)
Additional features of the EXT-SBC-i.MX51-COMM extension board:
- Bluetooth SPP module from Intel (former Infineon)
- GSM/GPRS module from ublox and SIM card slot
- GPS module from ublox
All parts are well supported by the provided GNU/Linux board support package for the SBC-i.MX51.
See the Additional Equipment page for equipment you may need.
Emerging Display ET0500G0DH6
- Type
- TFT-LCD with touch screen
- Resolution
- 800x480
- Orientation
- Landscape
Enabling in Linux
To use the TFT as primary display, you have to supply an additional Linux kernel argument. You can configure this easily in the Redboot boot loader:
When Redboot is loading, press [ Ctrl+c ] to stop the boot process. Now add
display=emerging
to the kernel options (in the boot script), e.g.
e -c "console=ttymxc0,115200 root=/dev/mmcblk0p1 rw debug noinitrd psplash=false rootdelay=1 display=emerging"
Then reset the board (or type reset in Redboot), and the Linux kernel will automatically use the Emerging display as primary screen.
Test in Linux
After Linux boot, you should see the login prompt on the screen (console image).
Touch screen calibration
In the sbc-imx51-qtembedded-image, the application
ts_calibrate
is included. Execute it to calibrate the touch screen.
Backlight intensity
Backlight intensity is regulated by the PWM backlight driver. Write any value between 0 (dark) and 255 (brightest) to the file
echo 255 > /sys/class/backlight/pwm-backlight/brightness
To get the current brightness, write
cat /sys/class/backlight/pwm-backlight/actual_brightness
Qt Embedded demo application
If you are using the sbc-imx51-qtembedded-image, there's a small demo application that lets you switch on and off the LEDs of the SBC via buttons on the display.
Steps:
- Calibrate your touch screen, as specified earlier
- Set a variable so that Qt takes the touch screen as main input
export QWS_MOUSE_PROTO=TsLib:/dev/input/touchscreen0
- Execute the demo application
/usr/bin/qtopia/demos/sbcled/sbcled -qws
Toshiba display LT084AC37100 (LVDS)
- Type
- TFT-LCD with touch screen
- Resolution
- 1024x768
- Orientation
- Landscape
Connections
SBC HW Rev. 2.1 and COMM adapter HW Rev. 1.0
- Connect the 6-pin flat cable to the COMM adapter (connector X2).
- Connect the data cable to connector X1.
- Connect the 4-pin flat cable (touch screen) to connector X4.
- Connect display power (12V DC):
- Either supply directly on connector X3, whereas the 12V pin is the one nearest to X4, and the GND pin is the opposite one. Leave the one in the middle unconnected.
- You may connect X3 on the COMM adapter to X18 on the SBC board. The pin nearest to X4 (COMM) must be connected to the pin nearest to the power plug (SBC). You must supply the SBC board now with 12V DC exactly!
SBC HW Rev. 2.1 and COMM adapter HW Rev. 1.1
- Connect the 6-pin flat cable to the COMM adapter (connector X2).
- Connect the data cable to connector X1.
- Connect the 4-pin flat cable (touch screen) to connector X4.
- Connect display power (12V DC):
- Either supply directly on connector X3, whereas the 12V and GND pins are labeled. Leave the one in the middle unconnected.
- You may connect X3 on the COMM adapter to X18 on the SBC board. The 12V pin on the COMM/DISP must be connected to the pin nearest to the power plug (SBC). You must supply the SBC board now with 12V DC exactly!
Enabling in Linux
To use the TFT as primary display, you have to supply an additional Linux kernel argument. You can configure this easily in the Redboot boot loader:
When Redboot is loading, press [ Ctrl+c ] to stop the boot process. Now add
display=toshiba
to the kernel options (in the boot script), e.g.
e -c "console=ttymxc0,115200 root=/dev/mmcblk0p1 rw debug noinitrd psplash=false rootdelay=1 display=toshiba"
Then reset the board (or type reset in Redboot), and the Linux kernel will automatically use the Toshiba display as primary screen.
Further steps are identical to the Emerging display, so please see above!
OV2655 (HW Rev. 1.0 only)
- Type
- Image sensor (camera)
- Resolution
- 2 megapixel
- Orientation
- Landscape
Enabling in Linux
NOTE: The OV2655 driver from our GIT is incomplete, it is missing the actual camera initialization sequences. This code is under NDA by OmniVision. Please contact us if you want to use the camera and need the full device driver sources.
The Linux device driver currently supports the following camera modes:
- 800x600, 25 fps
- 640x480, 25 fps
Kernel configuration:
Device Drivers ---> Multimedia devices ---> <*> Video For Linux [*] Enable Video For Linux API 1 (DEPRECATED) [*] Customize analog and hybrid tuner modules to build ---> [*] Video capture adapters ---> <M> MXC Video For Linux Camera MXC Camera/V4L2 PRP Features support ---> <M> OmniVision ov2655 camera support <M> Pre-Processor VF SDC library <M> Pre-processor Encoder library <*> MXC Video For Linux Video Output [*] IPU v4l2 support
Test in Linux
We will set up an overlay so that you can see the camera picture on the HDMI monitor connected to the SBC-i.MX51. You need the imx-test package which is installed in SBC Linux images by default.
- Load the camera kernel module:
modprobe ov2655_camera
- Load the i.MX capture kernel module:
modprobe mxc_v4l2_capture
- Start the unit test for overlay:
/unit_tests/mxc_v4l2_overlay.out -iw 800 -ih 600 -ow 800 -oh 600 -fr 25 -fg
- Now you should see the video stream from the camera on the monitor. Stop overlay by pressing [ Ctrl+c ].
ISM-MT9M131 camera module (HW Rev. 1.2 and above)
NOTE! You need an EXT-SBC-i.MX51-COMM/DISP ≥V1.2 extension board, V1.1 will not work.
- Type
- Image sensor (camera)
- Resolution
- 1280x1024
- Orientation
- Landscape
The module manufactured by Bluetechnix features an Aptina MT9M131 camera SOC (System-on-a-Chip). See https://datasheets.becom-group.com/goto/ISM/ISM-MT9M131/ for the data sheet.
There is a Linux device driver that allows for live view and capturing. It employs the RGB565-mode of the camera. Some parameters may be set by module parameters.
Enabling in Linux
Kernel configuration:
Device Drivers ---> Multimedia devices ---> <*> Video For Linux [*] Enable Video For Linux API 1 (DEPRECATED) [*] Customize analog and hybrid tuner modules to build ---> [*] Video capture adapters ---> <M> MXC Video For Linux Camera MXC Camera/V4L2 PRP Features support ---> <M> Bluetechnix ISM-MT9M131 camera module support <M> Pre-Processor VF SDC library <M> Pre-processor Encoder library <M> IPU CSI Encoder library <*> MXC Video For Linux Video Output [*] IPU v4l2 support
Test in Linux
You need the imx-test package which is installed in SBC Linux images by default.
Live view (camera to HDMI)
- Load the camera kernel module:
modprobe ism_mt9m131_camera sensorwidth=1280 sensorheight=1024
- Load the i.MX capture kernel module:
modprobe mxc_v4l2_capture
- Start live view:
/unit_tests/mxc_v4l2_overlay.out -iw 1024 -ow 1024 -ih 768 -oh 768 -fg -fr 25
Capturing raw stream
There is also a unit test for capturing the raw RGB565 stream to a file.
- Load the camera kernel module.
modprobe ism_mt9m131_camera
- Load the i.MX capture kernel module:
modprobe mxc_v4l2_capture
- Capture 100 frames and save to a file (Note that /var/volatile is a file system in RAM):
cd /var/volatile /unit_tests/mxc_v4l2_capture.out -iw 1024 -ow 1024 -ih 768 -oh 768 -fr 25 /var/volatile/video.out
- Transfer video.out to your PC where the mplayer is installed.
- Play it with mplayer
mplayer -demuxer rawvideo -rawvideo fps=25:w=1024:h=768 video.out
Additional information
- Kernel module parameters
- The following kernel parameters may be used to initialize the camera.
- E.g., type modprobe ism_mt9m131_camera testpattern=7 to enable a test pattern.
- testpattern=X (Test pattern: 0=disable (default), 1..6=various solid colors, 7=color bar)
- sensorwidth=X (Sensor width, default 1280)
- sensorheight=X (Sensor height, default 1024)
- Sensor size and frame rate
- Note that the size of the sensor is only set by loading the module with respective parameters. The window size of the sensor can not be altered by parameters to mxc_v4l2_capture or mxc_v4l2_overlay unit test applications. The frame rate - on the other size - can be altered by these applications (and hence, through the V4L2 frame work).
- Frame rates measured during live view
- (We presume good light conditions. The MT9M131 SOC automatically decreases the frame rate when light conditions are not good.)
- 1280x1024: 16 fps
- 1024x768: 25 fps
- 800x600: 26 fps
- 640x480: 27 fps
ISM-MT9M024 camera module (HW Rev. 1.2 and above)
NOTE! You need an EXT-SBC-i.MX51-COMM/DISP ≥V1.2 extension board, V1.1 will not work.
- Type
- Image sensor (camera)
- Resolution
- 1280x768
- Orientation
- Landscape
- Camera types
- Color (Bayer pattern, i.e., first row GRGR...., second row BGBG...., ....)
- Monochrome
- RCCC (Red, Clear, Clear, Clear)
- Field
- Automotive
- Data width
- 12 bit; limited to 10 bit if connected with SBC-i.MX51
The module manufactured by Bluetechnix features an Aptina MT9M024 camera. See https://datasheets.becom-group.com/goto/ISM/ISM-MT9M024/ for the data sheet.
These cameras can only deliver raw data and are missing white balancing, gamma correction, etc. There is only limited support of the i.MX IPU for such raw formats (live view, etc.).
There is a Linux device driver that allows capturing the raw frames. It supports data widths of 8 and 10 bits, and setting various camera parameters and functions.
Enabling in Linux
Kernel configuration:
Device Drivers ---> Multimedia devices ---> <*> Video For Linux [*] Enable Video For Linux API 1 (DEPRECATED) [*] Customize analog and hybrid tuner modules to build ---> [*] Video capture adapters ---> <M> MXC Video For Linux Camera MXC Camera/V4L2 PRP Features support ---> <M> Bluetechnix ISM-MT9M024 camera module support <M> Pre-Processor VF SDC library <M> Pre-processor Encoder library <M> IPU CSI Encoder library <*> MXC Video For Linux Video Output [*] IPU v4l2 support
Test in Linux (8-bit mode)
You need the imx-test package which is installed in SBC Linux images by default.
- Load the camera kernel module:
modprobe ism_mt9m024_camera
- Load the i.MX capture kernel module:
modprobe mxc_v4l2_capture
- Capture 100 frames and save to a file (Note that /var/volatile is a file system in RAM):
cd /var/volatile /unit_tests/capture-mt9m024.out -f "GREY" video.raw
- If you get an error now ("VIDIOC_DQBUF failed"), unblank your frame buffer before starting capture-mt9m024.out. (Maybe an IPU driver bug?)
echo 0 > /sys/class/graphics/fb0/blank
- If you transfer video.raw to your PC where the mplayer is installed, you can get a first glance of the video by playing it as a grayscale video:
mplayer -demuxer rawvideo -rawvideo fps=25:w=1280:h=960:y8 video.raw
- There is a little application to convert the raw video to an UYVY format:
openembedded/recipes/sbc-imx51-support/files/raw2yuv.c
- Compile it on your PC with:
gcc -o raw2yuv raw2yuv.c -lm -O2 -Wall
- Convert the raw image stream (RGB BAYER type):
./raw2yuv BAYER 1280 960 0.8 1.0 0.6 1 video.raw video.yuv
- Play it with mplayer
mplayer -demuxer rawvideo -rawvideo fps=25:w=1280:h=960:uyvy video.yuv
(Note that the actual frame rate is told you by the capture-mt9m024.out application after capturing.)
Test in Linux (10-bit mode)
- Load the camera kernel module. In case it is already loaded, we unload it in the first instance:
modprobe -r ism_mt9m024_camera modprobe ism_mt9m024_camera datawidth=10
- Load the i.MX capture kernel module:
modprobe mxc_v4l2_capture
- Capture 100 frames and save to a file (Note that /var/volatile is a file system in RAM):
cd /var/volatile /unit_tests/capture-mt9m024.out -f "Y16 " video.raw
- If you get an error now ("VIDIOC_DQBUF failed"), unblank your frame buffer before starting capture-mt9m024.out. (Maybe an IPU driver bug?)
echo 0 > /sys/class/graphics/fb0/blank
- Transfer video.raw to your PC where the mplayer is installed.
- There is a little application to convert the raw video to an UYVY format:
openembedded/recipes/sbc-imx51-support/files/raw2yuv.c
- Compile it on your PC with:
gcc -o raw2yuv raw2yuv.c -lm -O2 -Wall
- Convert the raw image stream (RGB BAYER type):
./raw2yuv BAYER 1280 960 0.8 1.0 0.6 2 video.raw video.yuv
- Play it with mplayer
mplayer -demuxer rawvideo -rawvideo fps=25:w=1280:h=960:uyvy video.yuv
(Note that the actual frame rate is told you by the capture-mt9m024.out application after capturing.)
Additional information
- Kernel module parameters
- The following kernel parameters may be used to initialize the camera.
- E.g., type modprobe ism_mt9m024_camera testpattern=2 to enable a test pattern.
- testpattern=X (Test pattern: 0=disable (default), 1=solid color, 2=color bar, 3=fade-to-gray color bar, 4=walking 1s)
- autoexposure=X (Auto exposure: 0=disable, 1=enable (default))
- hdrmode=X (High dynamic range mode: 0=disable (default), 1=enable)
- sensorwidth=X (Sensor width, default 1280)
- sensorheight=X (Sensor height, default 960)
- datawidth=X (Data width: 8 (default), 10)
- capture-mt9m024.out application
- Getting help: Type ./capture-mt9m024.out -help to see the argument list
- The application is meant as a demo application. It can only save the captured raw stream to a file. It is meant a basis for your development - wherever you want to have the video data...
- Default settings are:
int g_in_width = 1280; int g_in_height = 960; int g_out_width = 1280; int g_out_height = 960; int g_top = 2; int g_left = 0; int g_input = 1; int g_capture_count = 100; int g_rotate = 0; int g_cap_fmt = V4L2_PIX_FMT_GREY; int g_camera_framerate = 25; int g_extra_pixel = 0; int g_capture_mode = 0;
- Use pixel format "Y16 " for 16 bits per pixel (camera data width: 10 bits)
- Use pixel format "GREY" for 8 bits per pixel (camera data width: 8 bits)
- Windowing
- You may specify width, height, left, and top values of the captured picture. E.g., to capture VGA size,
./capture-mt9m024.out -iw 640 -ow 640 -ih 480 -oh 480 -l 320 -t 242 [-f "Y16 "] video.raw
- (Note that the first two lines received by the camera contain statistics information, we usually cut them out of the captured picture by adding 2 to the top offset.)
- Always take the same values for -iw and -ow, as well as for -ih and -oh.
- Always choose even values.
- raw2yuv application
- Usage: ./raw2yuv BAYER <pixel-width> <pixel-height> <gammared> <gammagreen> <gammablue> <bytes-per-pixel> <in-file> <out-file>
- Values for gamma vary; you may try 0.8, 1.0, and 0.6 first.
Bluetooth module eUniStone PBA31308/2 SPP-AT
This Bluetooth module is capable of AT-commands communication and the Bluetooth SPP (Serial Port Profile).
See https://www.infineon.com/cms/en/product/channel.html?channel=db3a30431ed1d7b2011f038697c5736c&tab=2 for the data sheet and a reference for all AT commands.
Enabling in Linux
Configure the Linux kernel with the following configuration options (It's already enabled in the default configuration).
Device Drivers ---> MXC support drivers ---> MXC Bluetooth support ---> <M> MXC Bluetooth support
Establishing a serial channel over Bluetooth
We assume that you have a PC with Bluetooth adapter ready. We used the Ubuntu operating system on this PC to test the Bluetooth connection. We prepend individual steps with the keywords [SBC] or [PC] to make clear on which machine this step must be executed.
- [SBC] After booting the Linux OS on the SBC-i.MX51, setup the minicom terminal program first. Edit the file
/etc/minirc.dfl
It should look like this:
pu port /dev/ttymxc2 pu rtscts No
- [SBC] Start minicom with
minicom -o
- [PC] Now, you need a second serial connection to the SBC, e.g. via an SSH shell.
- [SBC] Load the kernel module
modprobe mxc_bt
minicom should output
ROK
from the Bluetooth module.
- [SBC] In minicom, enter the following commands which enable security mode, the serial port service and connection auto accept on the Bluetooth module. Note that the Bluetooth module expects a carriage return and a line feed character after each command. In minicom, type Enter followed by Ctrl-j to generate the correct characters. If you paste the commands from this page, we observed that hitting Enter after pasting works too. You won't see the characters you typed in minicom, but you must get an OK response after each of the commands.
AT+JSEC=1,1,1,04,1111 AT+JDIS=3 AT+JRLS=1101,11,Serial Port,01,000000 AT+JAAC=1
- [PC] Now, in Ubuntu, open a terminal and type:
hcitool scan
You will get a list of all active Bluetooth devices - PMB8753-2B should be among them.
harald@WS-HP4600-35:~$ hcitool scan Scanning ... 00:03:19:06:E0:E3 PMB8753-2B
- [PC] Tell hcitool to establish a connection to the module. Use the Bluetooth address you got from the last output.
harald@WS-HP4600-35:~$ sudo hcitool cc 00:03:19:06:E0:E3
The tool will report if an error occurs, else there is no output.
- [PC] We use the address to get some more information about the module and its services:
harald@WS-HP4600-35:~$ sdptool browse 00:03:19:06:E0:E3 Browsing 00:03:19:06:E0:E3 ... Service Name: Serial Port Service RecHandle: 0x10000 Service Class ID List: "Serial Port" (0x1101) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1
The information we need is the channel number, which is 1 here.
- [PC] Now we connect to the RFCOMM service of the Bluetooth module:
harald@WS-HP4600-35:~$ sudo rfcomm connect hci0 00:03:19:06:E0:E3 1 Connected /dev/rfcomm0 to 00:03:19:06:E0:E3 on channel 1 Press CTRL-C for hangup
So, /dev/rfcomm0 is the character device file for the Bluetooth serial port.
- [SBC] You can see the following new messages printed in minicom, the first one is a connect indication:
+RCOI=00025B01160A +RCCRCNF=350,0
- [SBC] Put the Bluetooth module in streaming mode now:
AT+JSCR
- [PC] Finally, we configure minicom on the PC
- Start sudo minicom -s, select device /dev/rfcomm0, save as default, and quit
- Then start sudo minicom -o
- If you type anything in the minicom window (either SBC or PC), the other side will receive it. Type [ Ctrl-j ] for a newline.
GSM/GPRS module ublox LEON-G100
Enabling in Linux
There is a small device driver that turns on the module and resets it properly:
Device Drivers ---> SBC-i.MX51 support drivers ---> GSM/GPRS support ---> <M> SBC-i.MX51 GSM/GPRS support
It is enabled in the default kernel configuration.
Testing in Linux
First, load the kernel module:
modprobe gsm
We use the program minicom to test communication with the GSM/GPRS module. For configuration, either create the file
/etc/minirc.dfl
with the following content
# Machine-generated file - use "minicom -s" to change parameters. pu port /dev/ttymxc1 pu rtscts No
Alternatively, start minicom with the -s parameter, and do the following:
- Go to Serial port setup and change Serial Device to /dev/ttymxc1 (key A).
- In the same menu, turn off Hardware Flow Control (key F).
- Press ENTER to leave the menu.
- Select Save setup as dfl.
- Select Exit from Minicom.
To ensure that communication is working, we start
minicom
and request some information from the module (input bold):
AT+CGMI u-blox OK AT+CGMM LEON-G100 OK AT+CGMR 07.30.03 OK
Note that you may reset the GSM/GPRS module at any time by unloading and re-loading the kernel module:
modprobe -r gsm modprobe gsm
Establish an Internet connection with PPPD
Now that we have checked the communication with the modem, we demonstrate how to establish an Internet connection.
- First - if you have not done already - shut down your SBC-i.MX51, remove the COMM adapter, and insert a SIM card on the bottom side. Connect a GSM antenna to connector X8 as well. Then boot up Linux again.
- Edit the file
/etc/chatscripts/ppp
either directly on the SBC (use nano or vi) or in OpenEmbedded's repository:
oe/openembedded/recipes/sbc-imx51-support/files/chat-config
The file contains the required configuration such as PIN, APN (access point name), and phone number. You have to customize items marked red:
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED # modeminit '' AT+CMEE=2 TIMEOUT 3 OK AT+CPIN? 'READY-AT+CPIN="1234"-' '' 'OK' 'ATZ' OK AT&K0 TIMEOUT 10 'OK' 'AT+CGDCONT=1,"IP","web.yesss.at"' 'OK' 'ATD*99#' CONNECT \d\c # end of pppconfig stuff
Afterwards, try establishing the connection with the following command. Note that if connection fails, it's worth that you retry.
pppd call ppp nodetach
If everything works fine, then you will see a similar output:
root@sbc-imx51:~# pppd call ppp nodetach abort on (BUSY) abort on (NO CARRIER) abort on (VOICE) abort on (NO DIALTONE) abort on (NO DIAL TONE) abort on (NO ANSWER) abort on (DELAYED) send (AT+CMEE=2^M) timeout set to 3 seconds expect (OK) AT+CMEE=2^M^M OK -- got it send (AT+CPIN?^M) expect (READY) ^M AT+CPIN?^M^M +CPIN: READY -- got it send (^M) expect (OK) ^M ^M OK -- got it send (ATZ^M) expect (OK) ^M ^MATZ^M^M OK -- got it send (AT&K0^M) timeout set to 10 seconds expect (OK) ^M AT&K0^M^M OK -- got it send (AT+CGDCONT=1,"IP","web.yesss.at"^M) expect (OK) ^M AT+CGDCONT=1,"IP","web.yesss.at"^M^M OK -- got it send (ATD*99#^M) expect (CONNECT) ^M ATD*99#^M^M CONNECT -- got it send (\d) Serial connection established. using channel 2 Using interface ppp0 Connect: ppp0 <--> /dev/ttymxc1 sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x78d8680c> <pcomp> <accomp>] sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x78d8680c> <pcomp> <accomp>] sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x78d8680c> <pcomp> <accomp>] sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x78d8680c> <pcomp> <accomp>] rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x71dfe05e> <pcomp> <accomp>] sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x71dfe05e> <pcomp> <accomp>] rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x78d8680c> <pcomp> <accomp>] sent [CCP ConfReq id=0x1 <mppe -H -M -S -L -D -C> <deflate 15> <deflate(old#) 15> <bsd v1 15>] sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>] rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 15 12 06 00 00 00 00 1a 04 78 00 18 04 78 00 15] rcvd [IPCP ConfReq id=0x1 <addr 10.114.147.229>] sent [IPCP ConfAck id=0x1 <addr 10.114.147.229>] rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>] sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>] rcvd [IPCP ConfNak id=0x2 <addr 10.114.147.229> <ms-dns1 194.24.128.100> <ms-dns3 81.3.216.100>] sent [IPCP ConfReq id=0x3 <addr 10.114.147.229> <ms-dns1 194.24.128.100> <ms-dns3 81.3.216.100>] rcvd [IPCP ConfAck id=0x3 <addr 10.114.147.229> <ms-dns1 194.24.128.100> <ms-dns3 81.3.216.100>] replacing old default route to eth0 [192.168.1.1] local IP address 10.114.147.229 remote IP address 10.114.147.229 primary DNS address 194.24.128.100 secondary DNS address 81.3.216.100 Script /etc/ppp/ip-up started (pid 2701) Script /etc/ppp/ip-up finished (pid 2701), status = 0x0
To disconnect, hit [ Ctrl+c ].
Debugging
What you may try if you don't get a connection
- You may test the effects of AT commands directly with
minicom -o
An init sequence could be:
AT+CPIN="1234" ATZ AT&K0 ATQ0
- You may enable verbose error messages instead of the generic ERROR:
AT+CMEE=2
- Check if your service provider's signal is available with the +COPS command:
AT+COPS=?
You should see your service provider in the list.
- If anything goes wrong after seeing the CONNECT from the modem, you may have a look at PPPD's configuration file
/etc/ppp/peers/ppp
or
oe/openembedded/recipes/sbc-imx51-support/files/ppp-config
respectively within OpenEmbedded's tree for enabling/disabling compression protocols, settings for default route and DNS servers, etc.
Help resources
- The ppp and chat man pages, usually installed on Linux PCs:
man ppp man chat
- ublox data sheets and references, available from https://www.u-blox.com/en/download/documents-a-resources/leon-modules-resources.html
- LEON-G100/200 Data Sheet
- LEON-G100/200 AT Commands Manual
GPS module ublox NEO-6Q
The module's data sheet is available at https://www.u-blox.com/en/gps-modules/pvt-modules/neo-6-family.html
You may be interested in another document about Linux USB connections and GPS graphical demo: https://www.u-blox.com/en/usb-drivers/linux-driver.html
Enabling in Linux
The module is connected to the i.MX51 via USB. We are using the usbserial driver to read out data from module. This device driver is built automatically with the default Linux kernel configuration. For your reference, the following kernel configuration is specific to the GPS module:
Device Drivers ---> [*] USB support ---> <M> USB Serial Converter support ---> [*] USB Generic Serial Driver SBC-i.MX51 support drivers ---> GPS support ---> <*> SBC-i.MX51 GPS support
(The first device driver handles communication, the second one enables voltages and configures GPIOs appropriately.)
Proper loading of the usbserial kernel module is handled by udev during Linux boot. The udev rules are contained in the following file within your development tree.
openembedded/recipes/udev/udev-151/sbc/76-gps.rules
Test in Linux
After the SBC-i.MX51 has booted one of the demo images, check if the GPS module was detected with lsusb.
root@sbc-imx51:~# lsusb [...] Bus 002 Device 005: ID 1546:01a6 U-Blox AG root@sbc-imx51:~#
You may also get more information, please use the bus and device numbers from the output above:
root@sbc-imx51:~# lsusb -s2:5 -v Bus 002 Device 005: ID 1546:01a6 U-Blox AG Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 2 Communications bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1546 U-Blox AG idProduct 0x01a6 bcdDevice 6.02 iManufacturer 1 u-blox AG - www.u-blox.com iProduct 2 u-blox 6 - GPS Receiver [...]
Next, check if the usbserial kernel module was loaded appropriately by udev and if the /dev/ttyUSB0 character device was created:
root@sbc-imx51:~# lsmod Module Size Used by usbserial 34512 0 [...] root@sbc-imx51:~# ls -l /dev/ttyUSB* crw-rw---- 1 root dialout 188, 0 Oct 9 2010 /dev/ttyUSB0 root@sbc-imx51:~#
Then, simply open a cat on this device to see the GPS data strings (protocol: NMEA):
root@sbc-imx51:~# cat /dev/ttyUSB0 $GPTXT,01,01,02,u-blox ag - www.u-blox.com*50 $GPTXT,01,01,02,HW UBX-G60xx 00040007 *52 $GPTXT,01,01,02,ROM CORE 6.02 (36023) Oct 15 2009 16:52:08*56 $GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20 $GPTXT,01,01,02,ANTSTATUS=OK*3B $GPRMC,,V,,,,,,,,,,N*53 $GPVTG,,,,,,,,,N*30 $GPGGA,,,,,,0,00,99.99,,,,,,*48 $GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30 $GPGSV,1,1,00*79 [...]
You can use the simple program
gpsmon /dev/ttyUSB0
for checking if your signal quality is good enough, and if the GPS module can determine your position. Look for Latitude and Longitude! Here is an example:
127.0.0.1:2947:/dev/ttyUSB0 Generic NMEA> ┌──────────────────────────────────────────────────────────────────────────────┐ │Time: 2010-12-16T16:03:47.0Z Lat: 48 10' 30.681" N Lon: 16 16' 59.785" E │ └───────────────────────────────── Cooked PVT ──────────────Lon: ──────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ GPRMC GPVTG GPGGA GPGSA GPGSV GPGLL │ └───────────────────────────────── Sentences ──────────────────────────────────┘ ┌──────────────────┐┌────────────────────────────┐┌────────────────────────────┐ │Ch PRN Az El S/N ││Time: 160347.00 ││Time: 160346.00 │ │ 0 4 310 1 0 ││Latitude: 4810.51136 N ││Latitude: 4810.51135 │ │ 1 11 174 53 19 ││Longitude: 01616.99642 E ││Longitude: 01616.99647 │ │ 2 12 357 0 0 ││Speed: 0.776 ││Altitude: 240.9 │ │ 3 13 211 13 30 ││Course: 118.34 ││Quality: 2 Sats: 07 │ │ 4 14 42 5 0 ││Status: A FAA: D ││HDOP: 1.25 │ │ 5 17 282 36 35 ││MagVar: ││Geoid: 42.1 │ │ 6 20 304 78 21 │└─────────── RMC ────────────┘└─────────── GGA ────────────┘ │ 7 23 205 45 32 │┌────────────────────────────┐ │ 8 24 142 53 23 ││Mode: A 3 │ │ 9 31 80 31 17 ││Sats: 23 17 20 31 24 11 13 │ │10 32 63 66 0 ││DOP: H=1.25 V=1.77 P=2.17 │ │11 33 219 27 36 │└─────────── GSA ────────────┘ └────── GSV ───────┘ (35) $GPVTG,,T,,M,0.776,N,1.437,K,D*21\x0d\x0a
GUI support
There is a nice Linux application called gpsdrive which is installed by default in the Gnome demo image for the SBC-i.MX51.
Instructions
- In Gnome, open a terminal and start the gpsd daemon:
gpsd /dev/ttyUSB0
- Afterwards, simply start the gpsdrive GUI
gpsdrive
gpsdrive tells you the current GPS status, the current position, and displays the current map. You can also download maps for a specific location.
- If you start gpsd with the -G switch, a TCP port on the SBC is opened, where you can connect with any GPS client (such as xgps or gpsdrive, which are both available in Ubuntu) over the Ethernet. We assume that the SBC's IP address is 192.168.1.10 here:
gpsd -G /dev/ttyUSB0
xgps 192.168.1.10:2947 gpsdrive -b 192.168.1.10
References
Have a look at a document from ublox who also tested gpsdrive: https://www.u-blox.com/en/usb-drivers/linux-driver.html
gpsdrive web site: https://gpsd.berlios.de/
gpsd web site: https://www.gpsdrive.de/