Thales IoT Developer Community
Concept Board: External camera support
Tutorial, September 25, 2014 - 4:38pm, 4949 views
This tutorial shows how to connect properly serial JPEG camera to Concept Board and make it work. The libraries and application were created by student workers in REC Global department in Wrocław.
- Concept Board
- JPEG Camera with serial port (ZM 1.3MP Serial Camera Module)
- Eclipse Juno with CMTK Kit
- Gemalto EHSx Software Development Kit
- Connect RX and TX to ASC1 pin-outs in the shield interface.
- Put switchers from D2 to D7 in GPIO I/O Direction Configuration to OUT position.
- Be sure that ASC1 is set to RX/TX position in Serial configuration switch.
Connect board to the PC and change DAI, PULSE and PWM to gpio **** and restart module with CFUN.
Classes used in the project include:
- class public CameraMIDlet - the main class in the project; it reads all the information concerning configuration from JAD configuration file and creates objects responsible for using camera and sending e-mails; it also handles errors and finishes the program in case of occurrence of any of them;
- class public Camera - connects with camera, sets camera parameters (like baud rate, compression, resolution etc.), takes and saves photos on local FFS;
- class public Port - creates input and output stream via serial between a module and an external device;
- class public Package - generates commands for the camera and decodes data received from device;
- class public MailSender - configures e-mail options and sends e-mails;
- class public Logger - provides interface to print out debug messages;
- class public ErrorCodes - contains status codes used by other classes in the project;
- class public GPIO - initializes buttons and LEDs;
- class public ATListener - simple listeners for AT Commands;
- class public GPIOListener - simple listeners for GPIO;
See class diagram below:
Application configuration should be done in MIDlet's JAD file.
- camera_baudrate - value of baud rate used in connection; standard speeds are: 115200, 57600, 38400; other are supported but not recommended on EHS6
- COM - name of serial port used to connect camera with module (on board)
- image_resolution - photo resolution in pixels. Supported resolutions are: 160x120, 320x240, 640x480, 1280x1024
- APN - APN service name
- mail_to - receiver’s e-mail address
- mail_topic - e-mail topic
- mail_content - e-mail content
- image_compression - quality of image (0 - worst, 100 - best)
- APN_pswd - APN service password
- APN_user - same as above
- PIN_VALUE - put here PIN code of SIM card you are already using to
- image_name - photo name
- LoggingLevel - type of messages displayed (0 - none, 1 - only std messages, 2 - error, 3 - all)
Application execution concept
- Registering to the network.
- Setting up camera and internet service configuration.
- Wait until D3 and D4 flash.
- Application is ready to use - now, to take photo and send it via e-mail, press button BTN-A.
- After taking a photo third LED (D5) will be turned on and the demo will proceed to configure smtp settings.
- If it succeeds, the fourth LED should start flashing.
- In the end program sends the photo using Internet and if everything ends with success, the fifth (D7) diode should start flashing.
- After a few seconds LED progress bar will reset and the demo will be ready to send another e-mail.
There are three main types of errors indicated by LEDs on Concept Board:
- Configuration Errors - if all LEDs start blinking constantly twice a second,
- Network Errors - if all LEDs are blinking once per second,
- Hardware Errors - if all LEDs are blinking once per 2 seconds.
Configuration Errors - all mistakes concerning configuration of MIDlet's JAD file (ex. value of compression out of range, e-mail address without '@').
Network Errors - they indicate problems with connecting to mobile network or Internet (ex. sending e-mail timeout).
Hardware Errors - all problems with connection between devices (ex. incorrect connection between camera and Concept Board).
Please share your opinion about our project and feel free to take our work and modify it in your own creative way.