My program stops after a few hours (such as 5 hours). OMEGA2P firmware Ω-ware 0.2.2 b202.



  • I am using OMEGA2P and firmware version : Ω-ware 0.2.2 b202.

    My program stops after a few hours (such as 5 hours).

    root@Omega-EBCC:~/www1# ps
    PID USER VSZ STAT COMMAND
    1591 root 48524 S /usr/bin/node /root/www1/build/serverTest.js
    2225 root 18312 S ./MPPT1
    21415 root 1188 R ps

    Both MPPT1 and serverTest.js programs' STAT is in S state.

    STAT S : interruptible sleep (waiting for an event to complete).

    Almost all process state is in S state.

    root@Omega-EBCC:~/www1# ps
    PID USER VSZ STAT COMMAND
    1 root 1528 S /sbin/procd
    2 root 0 SW [kthreadd]
    3 root 0 SW [ksoftirqd/0]
    5 root 0 SW< [kworker/0:0H]
    6 root 0 SW [kworker/u2:0]
    48 root 0 SW [kworker/u2:2]
    82 root 0 SW< [writeback]
    83 root 0 SW< [crypto]
    85 root 0 SW< [bioset]
    86 root 0 SW< [kblockd]
    121 root 0 SW [kworker/0:1]
    129 root 0 SW [kswapd0]
    180 root 0 SW [fsnotify_mark]
    190 root 0 SW [spi32766]
    221 root 0 SW< [bioset]
    226 root 0 SW< [bioset]
    231 root 0 SW< [bioset]
    236 root 0 SW< [bioset]
    241 root 0 SW< [bioset]
    246 root 0 SW< [bioset]
    251 root 0 SW< [bioset]
    279 root 0 SW< [ipv6_addrconf]
    285 root 0 SW< [deferwq]
    288 root 0 SW< [kworker/0:1H]
    360 root 0 SW< [bioset]
    361 root 0 SW [mmcqd/0]
    409 root 0 SWN [jffs2_gcd_mtd6]
    471 root 1180 S /sbin/ubusd
    472 root 892 S /sbin/askfirst /usr/libexec/login.sh
    577 root 0 SW [irq/0-max98090_]
    623 root 0 SW< [krfcommd]
    769 root 1224 S /sbin/logd -S 64
    780 root 2112 S /sbin/rpcd
    797 root 1104 S /sbin/mountd -f
    859 root 1700 S /sbin/netifd
    877 root 1416 S /usr/sbin/odhcpd
    920 root 1060 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
    939 root 1512 S /usr/sbin/uhttpd -f -h /www -r Omega-EBCC -x /cgi-bi
    946 nobody 1560 S avahi-daemon: running [Omega-EBCC.local]
    955 root 1920 S /usr/sbin/onion-helper
    1028 root 0 SW [RtmpCmdQTask]
    1036 root 0 SW [RtmpWscTask]
    1037 root 0 SW [RtmpMlmeTask]
    1068 root 0 SW [kworker/0:2]
    1203 root 928 S /sbin/ap_client preference ra0 apcli0 -1,-1,-1,-1,-1
    1278 root 1188 S udhcpc -p /var/run/udhcpc-apcli0.pid -s /lib/netifd/
    1429 dnsmasq 1052 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg02411c
    1487 mosquitt 3236 S mosquitto -c /etc/mosquitto/mosquitto.conf
    1495 root 43172 S /usr/bin/node /root/www1/build/serverTest.js
    1541 root 1192 S < /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.
    1556 nobody 1304 S /usr/sbin/shellinaboxd -t --service=/:LOGIN --css /u
    1568 nobody 1304 S /usr/sbin/shellinaboxd -t --service=/:LOGIN --css /u
    1591 root 48524 S /usr/bin/node /root/www1/build/serverTest.js
    1598 root 1128 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
    1613 root 1192 S -ash
    2225 root 18312 S ./MPPT1
    2898 root 1128 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
    2905 root 1196 S -ash
    21418 root 1188 R ps

    How can I solve this problem?

    The programs should not be stopped.

    It is very important for me.

    I will appreciate if I can be given answer or solution.

    Thank you very much.



  • The programs are not stopped in any long term sense. Only one process can be running at a time on a single CPU machine. The "S" indication is not actually stopped but an interruptible sleep state as you mentioned in your post, to be awakened and put back on as the active thread for a time slice in the future. Your program may be running just fine.

    Is there some other indication your program is stopping? Is there any logging?

    --Bill



  • Dear William Scott, Bill.

    The program stops operation and the log output screen is freezed.

    I am using socket communication with java program, UART communication, sleep function, and 3 threads.

    I put printf at every line of my program.

    The program stoped between printf function.

    Thank you very much.



  • @Ick-Sung-Choi Hi there! I was a bit surprised to see your posting on using Java as i know people have tried, with some success, but I've not heard of anyone developing an app with it. Then.....I looked at the process listing again and didn't see a JVM running, but did see a couple of Javascript processes. Correct?

    --Bill



  • Dear William Scott, Bill.

    My C program and java application(using nodejs node) is run.

    The following is java server.

    1495 root 43172 S /usr/bin/node /root/www1/build/serverTest.js

    The java server run child en.app.js java script.

    The hang is different whenever I run the program.

    This time, the serial port communication does not work even though it seems to send the message.

    The counter part MCU does not send/receive messages through serial port.

    Thank you very much.



  • You can try to re-deploy using the latest Onion build, which is running on the 4.14 kernel.

    $ oupgrade -l

    Be warned, though, I do not have good results running UART on this version. 0.2.2 b202 has other problems, but it is more stable for me.



  • Dear JP Norair.

    Thank you very much for your precious suggestion.

    I will try it.



  • @Ick-Sung-Choi With the program stopping, perhaps all programs are stopping. This is a symptom of running out of memory (RAM) or storage (among other things). I suggest writing a quickie program (Bash) to run from cron (https://docs.onion.io/omega2-docs/running-a-command-on-a-schedule.html), perhaps once per five minutes. Execute 'free -h' and 'df -h' and append their output to a file. Include a time tag with each append.

    Tail the output file while you are running (perhaps once per half hour) to determine if your storage and/or memory is being exhausted.

    take care!
    Bill



  • Dear William Scott.

    I really appreciate to you for your answer.

    My OMEGA 2+ system halts after about 2 days after running program.

    I will check the memory and disk space.

    I think the memory problem can be solved because OpenWRT linux uses virtual memory (memory using disk).

    Can I enlarge the virtual memory of OMEGA 2+?

    If I can do it, would you tell me how to enlarge the memory?

    Thank you very much.



  • @Ick-Sung-Choi Although you cannot increase RAM, you can indeed add swap space that effectively increases memory. Below I'll provide a link or two to Omega documentation on accomplishing exactly that. It will require a SD card on to which the expansion would occur.

    Expanding memory from O2 docs: https://docs.onion.io/omega2-docs/extending-omega-memory.html

    Instructions for adding and setting up SD card: https://github.com/pjobson/onion_omega2p_experiments/blob/master/docs/setting_up_sdcard_for_root_and_swap.md

    Also, I have working code (bash and Python) that will do everything for you. I could provide this to you (for free, of course). It is somewhat generalized and may work on any system. On the other hand it may be too specialized for my system. I'll provide a download link in a follow-up message.

    --Bill



  • @Ick-Sung-Choi Looks like there will be a little bit of work (not much) for me to make the code available. I'll do so later today.

    One thing, in my opinion, that you still need to do is make a determination as to whether or not running out of memory --or-- storage is indeed your problem. Adding storage and swap is a very good thing and I highly recommend it, however your problem may be something else entirely.

    At your convenience please test your system for decreasing memory and/or storage.

    --Bill



  • @Ick-Sung-Choi Here is a link to a collection of archives of a project I did some time ago --> Buoy project archive. Download the highest version archive to your system and un-archive it.

    Change directory to one level above the 'disk' subdirectory, of course after you've inserted a SD device into the O2+. Type the following commands:

    . disk/expand_mem
    expand mem

    The first command, the one with the leading period, simply brings the file and all of it's variables and functions into your current shell. The second command runs a function, coincidentally of the same name as the file. The function will call a number of other functions that will set up the device for use as expanded storage as well as allocate and enable swap space.

    This works well if executed from the "proper" directory installing a whole system for my project (which you don't want). If it fails it may just because I'm playing fast and loose with directories here. Let me know if it fails and I'll analyze.

    -take care!
    Bill



  • Dear William Scott, Bill.

    I really appreciate to you for your support.

    I will follow your instructions.

    Thank you very much.



  • Dear William Scott, Bill.

    I really appreciate to you for your support.

    I am using SD card file system in OMEGA2+ to extent storage.

    Can I use both SD card file system and swap file extension in SD card?

    I will really thank you if I can be given the method.

    It is very important job for me.

    The following is my setup procedure to use SD card file system.

    • File system extension procedure of OMEGA
    1. install file system program.
      opkg update
      opkg install e2fsprogs

    2. unmount SD card.
      umount /tmp/mounts/SD-P1

    3. format SD card
      mkfs.ext4 /dev/mmcblk0p1

    4. copy overlay
      mkdir /mnt/mmcblk0p1

    mount /dev/mmcblk0pl /mnt/
    mount /dev/mmcblk0pl /mnt/ ; tar -C /overlay -cvf - . | tar -C /mnt/ -xf - ; umount /mnt/

    1. auto-mount of overlay when start up.
      opkg update
      opkg install block-mount
      block detect > /etc/config/fstab

      vi /etc/config/fstab
      Find "option target '/mnt/mmcblk0p1'" and replace it with "option target '/overlay'"
      // Find "option enabled '0'" and replace it with "option enabled '1'"
      reboot

    2. Check SD card file system.
      df -h

    Thank you very much.



  • @Ick-Sung-Choi At a glance this looks good. You might also want to add swap space either through a storage partition or a file.

    --Bill



Looks like your connection to Community was lost, please wait while we try to reconnect.