Embedded Design of Automatically Sending MMS Based on VxWorks

Publisher:lidong4069Latest update time:2021-05-14 Source: eefocusKeywords:VxWorks Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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 realize many new applications. The embedded system that automatically sends MMS is one of such new applications. Under certain conditions, the system automatically sends MMS to the designated mobile communication terminal. This application system is an automatic MMS sending system that sets trigger conditions according to requirements. When the trigger conditions are met, the device automatically controls the capture and compression image components to shoot external images. After analog-to-digital conversion, digital compression and other processing, the processor performs MMS (Multimedia Message Service) protocol encapsulation, and the encapsulated data is sent to the mobile switching network via the mobile phone module and finally forwarded to the mobile communication terminal user.


System overall design ● System main processor


The system uses Samsung's 16/32-bit ARM7TDMI-based microprocessor, which has a maximum main frequency of 130MIPS and supports the 16-bit Thumb instruction set. Using the Thumb instruction set, you can get 32-bit system performance with a 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 SMS. The system principle is shown in Figure 1.



Figure 1 System block diagram


● System working principle and 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. After completing the user number account and identity authentication, it connects to the network. 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 for the conditions to be met to trigger the automatic sending of MMS.


(2) The device software can receive SMS (Short Message Service) messages, parse them, and take actions based on the parsed results. When the system receives a trigger from the user, it initiates a task to control the serial port UART to command and control the image capture and compression modules and take photos; after taking photos, it initiates a task to read the serial port and receive the image data sent back by the image capture and compression modules.


(3) After receiving the returned image data, the system initiates a task to encapsulate the image data into MMS. The encapsulation format fully complies with the MMS CLIENT protocol.


(4) The system initiates a task to establish a connection with the WAP information gateway using the WAP protocol. 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 a task to control the mobile phone module to send the color image to the mobile switching network using AT commands, and finally forwards it to the set target mobile communication terminal user, thereby 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. Part of the circuit is shown in Figure 2. SDRAM is used to cache image data, and FLASH is used to store the compression processor execution program image. In addition, the image compression processor module provides a UART interface to transfer the compressed image file to the main control processor module.



Figure 2 Image compression processing circuit



Figure 3 System serial port connection circuit


(2) Part 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 ● Operating system and development environment VxWorks is the real-time operating system with the largest number of users in the world. It has rich application software support, good technical services, scalability (VxWorks provides more than 1,800 application programming interfaces for users to choose and use), scalability (users can configure VxWorks according to their own application requirements to generate operating system images with various functions) and reliable system stability. This system mainly adopts its real-time, multi-tasking, priority-based preemptive scheduling, same-priority round-robin scheduling, communication and synchronization mechanisms between tasks, and communication mechanisms between tasks and interrupts.


The development environment of VxWorks is Tornado provided by Wind River. Tornado adopts the host-target machine development method. The host system uses a workstation or PC running Windows 2000/NT, and VxWorks runs on a target processor such as ARM. The host-target machine connection method adopted by Tornado is Ethernet, serial line, etc. The communication between the host and the target machine is completed by running the proxy process on each processor, so that the development tools on the host and the operating system of the target machine can be completely separated from the way of mutual connection. Tornado provides a variety of application tools such as a friendly visual development interface, a cross-compilation environment, a source code-level debugging tool, a target machine command interpreter, and a target machine status monitor, providing an efficient and reliable platform for application software development.


● Software Design Principles The software design adopts an event-driven mechanism; the interrupt event activates the ISR, which queues the event and notifies the processing task through the semaphore's v operation. The processing task performs the p operation and blocks when there is no event to be processed. If a semaphore is obtained, it performs corresponding processing 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 Flowchart


● Specific implementation of key software designs (1) When the system starts, it waits for a period of time. If it times out, it loads the kernel normally to boot. If it receives configuration parameter request information from the serial port UART, it sends the configuration file to the PC through the serial port UART. After the PC processes the configuration parameters, it sends 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 AT commands, then turn on the information notification function of the mobile phone, initialize the SMS processing to text mode, activate CDMA, and wait until the mobile phone signal is strong enough.


(3) When a short message that meets the triggering conditions is received, an interrupt processing task is initiated, the short message in the UIM card is read into the buffer, the short message is deleted, and the validity of the short message in the buffer is judged. If it is a valid short message, corresponding processing is performed, and then the parameters configured according to the short message are saved.


(4) The system initiates tasks to take photos and encapsulate them 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, then initialize the PPP connection, and set the corresponding IP parameters after the PPP connection is completed.


(5) Then initialize WAP related parameters, establish a WAP connection, call the MMS sending function to send the picture to the destination 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_t), MSG_Q_FIFO);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->pModemQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);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; i++){if (startPPP() == OK)break;pppDelete(0);taskDelay(30);wavecomLibInit();}if (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->motionDetction)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 and image compression processor modules, initializing mobile phone modem, establishing PPP connection, sending connection packets, disconnecting PPP connection and returning; establishing a task to check modem information reception, establishing the system main loop task, processing the modem information reception task and the content sent to the information queue in the interrupt handler in the main loop task.

[1] [2]
Keywords:VxWorks Reference address:Embedded Design of Automatically Sending MMS Based on VxWorks

Previous article:Hardware design of embedded marine navigator based on BeiDou II system
Next article:ARM driver development method based on FPGA under Linux platform

Recommended ReadingLatest update time:2024-11-16 14:38

Analysis of Common Exceptions in VxWorks Task Programming
During the task running process, some abnormal situations may occur, causing the task to fail to run normally or affecting the operating system. Generally speaking, these abnormalities are caused by logical errors in the program. It is particularly important to prevent these abnormal situations from occurring and to
[Industrial Control]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号