Embedded Design of Automatically Sending MMS Based on VxWorks

With the development of embedded applications and the maturity of 16/32-bit RISC processor technology, as well as the emergence and improvement of embedded operating systems that support various high-end processors, embedded wireless devices can use CDMA networks to implement many new applications. The embedded system that automatically sends MMS is one of this new application. Under certain conditions, the system automatically sends MMS to the designated mobile communication terminal.

With the development of embedded applications and the maturity of 16/32-bit RISC processor technology, as well as the emergence and improvement of embedded operating systems that support various high-end processors, embedded wireless devices can use CDMA networks to implement many new applications. The embedded system that automatically sends MMS is one of this new application. Under certain conditions, the system automatically sends MMS to the designated mobile communication terminal; this application system is an automatic MMS system that is set by the user according to the requirements of trigger conditions. When the trigger condition is met, the device will automatically control the capture and compression image components to shoot external images. After processing such as analog-to-digital conversion and digital compression, the processor will do the MMS (Multimedia Message Service) protocol encapsulation. The data is sent to the mobile switching network via the mobile phone module, and finally forwarded to the mobile communication terminal user.

Overall system design

● System main processor

The system uses Samsung’s 16/32-bit ARM7TDMI-based microprocessor, which has a maximum clock speed of 130MIPS and supports 16-bit Thumb instruction set. Using Thumb instruction set can achieve 32-bit system performance with 16-bit system overhead. .

● System principle block diagram

The system is logically divided into three parts: the image capture and image compression module is used to capture and compress images; the MMS protocol processing and main controller module processes image data and task control; the mobile phone module can send MMS and receive short messages. The principle of the system is shown in Figure 1.

Embedded Design of Automatically Sending MMS Based on VxWorks
Figure 1 System principle block diagram

System working principle steps

(1) After the system is powered on, the mobile phone module reads the UIM information and sends a wireless signal to find the CDMA network, and connects to the network after user number account and identity verification; then the system initiates a task to read the information in the mobile phone module to determine whether there is a network Connection, if there is a network connection, the system initiates a task and waits to meet the conditions that trigger the automatic sending of MMS.

(2) The device software can receive SMS (Short Message Service, short message service) information, analyze it, and act according to the result of the analysis. After receiving a user’s trigger, the system initiates a task to control the serial port UART to command control and take pictures of the image capture and compression module; after taking a picture, initiate a task to read the serial port and receive the image data returned by the image capture and compression module.

(3) After receiving the returned image data, the system initiates a task to perform MMS encapsulation on the image data, and the encapsulation format fully complies with the MMS CLIENT end protocol.

(4) The system initiates the task using the WAP protocol to establish a connection with the WAP information gateway. After the connection is established, the system transmits the encapsulated image data to the mobile phone module through the standard serial port UART. Finally, the system initiates the task and uses the AT command to control the mobile phone module to send color pictures to The mobile switching network is finally forwarded to the set target mobile communication terminal user, thus completing the function of automatically sending MMS.

System hardware design The technical points of system hardware design include the following parts.

(1) The image compression processing module completes the compression of digital image information, and part of the circuit is shown in Figure 2. SDRAM is used to cache image data, and FLASH is used to store the compressed processor execution program image. In addition, the image compression processor module provides a UART interface to transfer compressed image files to the main control processor module.


Figure 2 Image compression processing circuit


Figure 3 System serial port connection circuit

(2) Part of the circuit of the system serial port connection circuit is shown in Figure 3. The ARM7 processor provides a standard UART interface to connect to the mobile phone module, and also provides a serial interface to connect to the serial interface of the image compression processor module.

System software design

● FuckOperating system and development environment

VxWorks is currently the world’s largest real-time operating system with the largest number of users, with rich application software support, good technical services, scalability (VxWorks provides more than 1,800 application programming interfaces for users to choose and use), scalability (referring to Users can configure VxWorks according to their own application requirements to produce operating system images with various functions) and reliable system stability. This system mainly adopts its real-time, multitasking, priority-based preemptive scheduling, the same priority round-robin scheduling, the communication and synchronization mechanism between tasks, and the communication mechanism between tasks and interrupts.

The development environment of VxWorks is Tornado provided by WindRiver. Tornado adopts the host-target machine development method, the host system adopts a workstation or PC running Windows2000/NT, and VxWorks runs on target processors such as ARM. The host-target connection method used by Tornado is Ethernet, serial line, etc. The communication between the host and the target is completed by running the agent processes on the respective processors, so that the development tools on the host and the target are connected. The operating system can be completely disconnected from each other. Tornado provides a variety of application tools such as a friendly visual development interface, cross-compilation environment, source-level debugging tools, target machine command interpreter and target machine status monitor, providing an efficient and reliable platform for application software development.

Principles of Software Design

The software design uses an event-driven mechanism; interrupt events activate the ISR, and the ISR queues the event and informs the processing task through the v operation of the semaphore. The processing task performs the p operation and blocks when there is no event to be processed. If the semaphore is obtained, the corresponding processing is performed according to the content of the event queue; the event processing task is a permanent loop. The software design process is shown in Figure 4.


Figure 4 Software flow chart

● The concrete realization of the key design of the software

(1) When the system starts, wait for a period of time. If it times out, the kernel will be loaded normally for booting. If the configuration parameter request information is received from the serial port UART, the configuration file will be sent to the PC via the serial port UART; the PC will process the configuration parameters , And then send the parameters to the device through the serial port, and the device stores the parameters in the form of a file.

(2) Initialize the mobile phone module. First use the hard reset line of the mobile phone module to hard reset the mobile phone, wait until the mobile phone can respond to the AT command, then turn on the information notification function of the mobile phone, initialize the SMS processing to the text mode, activate CDMA, and wait until the mobile phone signal is strong enough.

(3) After receiving the short message that meets the trigger condition, initiate an interrupt processing task, read the short message in the UIM card into the buffer, delete the short message, and judge the validity of the short message in the buffer, if it is valid The short message will be processed accordingly, and then the parameters will be saved according to the configuration of the short message.

(4) The system initiates tasks to take pictures and packages according to the trigger parameters, and calls the function to establish a PPP connection. First, use the AT command ATD#777 to connect to CDMA, and then initialize the PPP connection. When the PPP connection is completed, set the corresponding IP parameters.

(5) Then initialize the WAP related parameters, establish a WAP connection, call the MMS sending function to send the picture to the target mobile communication terminal user, and disconnect the PPP connection.

The key source code is as follows. STATUS mmsmain(viod){int ioFd, i;pSysInfo = (sysInfo_t *) calloc(1, sizeof(sysInfo_t));pSysInfo->tickRate = SYS_TICK_RATE;pSysInfo->pQueue = msgQCreate( SYS_MSG_COUNT, sizeof(sysMsg_Q_t), MS ;pSysInfo->pCamQueue = msgQCreate( SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO );pSysInfo->pPhotoQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);pSysInfo-of(SYS_MS) );DEBUG_PRINT((“Now begin read config information… “));if (readFlash() == ERROR){initDefaultInfo();readFlash();}DEBUG_PRINT((“Now end read config information… “));# ifndef CDMA_MODULEwhile(wavecomLibInit() == ERROR);for (i=0; i= 2){DEBUG_PRINT((“startPPP ERROR! “));return ERROR;}if (wapInit()!= OK){DEBUG_PRINT(( “WapInit ERROR! “));return ERROR;}#elsecdmaLibInit();#endifsysRecvLibInit();taskSpawn(“tCamera”, 80, 0, 50 * 1024, cameraTask, pSysInfo->pCamQueue, pSysInfo->pPhotoQueue,2, 3,4,5,6,7,8,9);photoSendLibInit();taskDelay(2);irLibInit();if (sysInitInfo->mot ionDetction)camQSend(SYS_MOTION_PIC, NULL, 0x0200 + sysInitInfo->camPixel);commCallBackFun = commStrHandle;pSysInfo->initialized = TRUE;return OK;}

The main functions implemented are: initializing system parameters, initializing capture, image compression processor module, initializing mobile phone modem, establishing PPP connection, sending connection package, disconnecting PPP connection and returning; establishing check modem information receiving task, establishing system main loop task , Process the content sent to the message queue in the modem message receiving task and the interrupt handler in the main loop task.

This system for automatically sending MMS can be used for wireless monitoring and smart home security. The system’s sending and receiving mechanism uses CDMA network to transmit information. The target mobile communication terminal user can receive MMS sent by the system no matter where it is, thus enabling remote monitoring. And other functions, to provide users with more security and convenience.

The Links:   HDM64GS24Y-4-WRXF https://www.slw-ele.com/ltd121c33s.html“> LTD121C33S