Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: monitoring teensy from the web with Yun

  1. #1

    monitoring teensy from the web with Yun

    Hello,

    You may be already see an other topic Understand-Prog-pin-in-Teensy3-1. This lastest concerns more the hardware interfacing.

    Now, I would like to develop all others questions to get internet and tools using Yun (mine is Dragino Yun Shield 1.6 or 2.4) with teensy 3.2

    Q1: I was not aware about difficulty for compiling but it is the case for now and after some searching I decide to start this topic requiring solution to "simply" compile the bridge library. Does anyone already met the following Error ?
    Code:
    C:\Program Files\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-ar: C:\Users\richard\AppData\Local\Temp\buildb261c6bc621981c8ffad8d14f424bad0.tmp/core/Bridge.a: No such file or directory
    Thanks and best regards,
    Vincent


    edit: A1: cloning the repository https://github.com/PaulStoffregen/Bridge to replace installed library, the Bridge example seems working.

    Q2: Using string use quickly significant memory spaces. Does anyone see a better approach to concatenate some string (that is redirected to terminal of Yun)?
    Code:
      if (delayLogSensors.check()) {
        delayLogSensors.reset();
    
        if (linux != NULL) {
          sprintf(str2, "ref counter1 counter2 counter3 ");
          for (index = 0 ; index < NB_SENSOR ; index++)
          {
            sprintf(str1, "\r\n%d\t%d\t%d\t%d", index + 1, counter1[index], counter2[index], counter3[index]);
            strncat(str2, str1, SIZE_MESSAGE);
            counter1[index] = 0;
            counter2[index] = 0;
            counter3[index] = 0;
          }
          linux->log_linux(str2); //log_linux calling p.runShellCommand("echo `date +'%y.%m.%d %H:%M:%S'` : 'string to log' >> /mnt/sda1/messages");
        }
    
      }
    Q3: I cannot find the serial port in Linux Yun /dev, however it works from the Linux laptop and from the Yun I can program the teensy using "teensy_loader_cli -mmcu=mk20dx256 -w prog.hex -v". Any idea to access the serial port?
    Code:
    root@dragino-16c830:/usr/bin# ls -l  /dev
    drwxr-xr-x    2 root     root            60 Jan  1  1970 bsg
    drwxr-xr-x    3 root     root            60 Jan  1  1970 bus
    crw-r--r--    1 root     root        5,   1 Jan  1  1970 console
    crw-rw-rw-    1 root     root        1,   7 Jan  1  1970 full
    crw-r--r--    1 root     root       10, 229 Jul 10 08:30 fuse
    drwxr-xr-x    2 root     root            60 Jan  1  1970 input
    crw-r--r--    1 root     root        1,  11 Jan  1  1970 kmsg
    srw-rw-rw-    1 root     root             0 Jul 10 08:30 log
    crw-r--r--    1 root     root       10, 237 Jul 10 08:30 loop-control
    brw-r--r--    1 root     root        7,   0 Jul 10 08:30 loop0
    brw-r--r--    1 root     root        7,   1 Jul 10 08:30 loop1
    brw-r--r--    1 root     root        7,   2 Jul 10 08:30 loop2
    brw-r--r--    1 root     root        7,   3 Jul 10 08:30 loop3
    brw-r--r--    1 root     root        7,   4 Jul 10 08:30 loop4
    brw-r--r--    1 root     root        7,   5 Jul 10 08:30 loop5
    brw-r--r--    1 root     root        7,   6 Jul 10 08:30 loop6
    brw-r--r--    1 root     root        7,   7 Jul 10 08:30 loop7
    crw-r--r--    1 root     root        1,   1 Jan  1  1970 mem
    crw-r--r--    1 root     root       90,   0 Jan  1  1970 mtd0
    crw-r--r--    1 root     root       90,   1 Jan  1  1970 mtd0ro
    crw-r--r--    1 root     root       90,   2 Jan  1  1970 mtd1
    crw-r--r--    1 root     root       90,   3 Jan  1  1970 mtd1ro
    crw-r--r--    1 root     root       90,   4 Jan  1  1970 mtd2
    crw-r--r--    1 root     root       90,   5 Jan  1  1970 mtd2ro
    crw-r--r--    1 root     root       90,   6 Jan  1  1970 mtd3
    crw-r--r--    1 root     root       90,   7 Jan  1  1970 mtd3ro
    crw-r--r--    1 root     root       90,   8 Jan  1  1970 mtd4
    crw-r--r--    1 root     root       90,   9 Jan  1  1970 mtd4ro
    crw-r--r--    1 root     root       90,  10 Jan  1  1970 mtd5
    crw-r--r--    1 root     root       90,  11 Jan  1  1970 mtd5ro
    crw-r--r--    1 root     root       90,  12 Jan  1  1970 mtd6
    crw-r--r--    1 root     root       90,  13 Jan  1  1970 mtd6ro
    crw-r--r--    1 root     root       90,  14 Jan  1  1970 mtd7
    crw-r--r--    1 root     root       90,  15 Jan  1  1970 mtd7ro
    brw-r--r--    1 root     root       31,   0 Jan  1  1970 mtdblock0
    brw-r--r--    1 root     root       31,   1 Jan  1  1970 mtdblock1
    brw-r--r--    1 root     root       31,   2 Jan  1  1970 mtdblock2
    brw-r--r--    1 root     root       31,   3 Jan  1  1970 mtdblock3
    brw-r--r--    1 root     root       31,   4 Jan  1  1970 mtdblock4
    brw-r--r--    1 root     root       31,   5 Jan  1  1970 mtdblock5
    brw-r--r--    1 root     root       31,   6 Jan  1  1970 mtdblock6
    brw-r--r--    1 root     root       31,   7 Jan  1  1970 mtdblock7
    crw-rw-rw-    1 root     root        1,   3 Jan  1  1970 null
    crw-------    1 root     root      108,   0 Jul 10 08:30 ppp
    crw-rw-rw-    1 root     root        5,   2 Jul 17 07:46 ptmx
    drwxr-xr-x    2 root     root             0 Jan  1  1970 pts
    crw-r--r--    1 root     root        1,   8 Jan  1  1970 random
    brw-r--r--    1 root     root        8,   0 Jan  1  1970 sda
    brw-r--r--    1 root     root        8,   1 Jan  1  1970 sda1
    drwxr-xr-x    2 root     root            40 Jan  1  1970 shm
    crw-rw-rw-    1 root     root        5,   0 Jan  1  1970 tty
    crw-rw-rw-    1 root     root      253,   0 Jul 17 07:41 ttyATH0
    crw-rw-rw-    1 root     root        4,  64 Jan  1  1970 ttyS0
    crw-rw-rw-    1 root     root        4,  65 Jan  1  1970 ttyS1
    crw-rw-rw-    1 root     root        4,  74 Jan  1  1970 ttyS10
    crw-rw-rw-    1 root     root        4,  75 Jan  1  1970 ttyS11
    crw-rw-rw-    1 root     root        4,  76 Jan  1  1970 ttyS12
    crw-rw-rw-    1 root     root        4,  77 Jan  1  1970 ttyS13
    crw-rw-rw-    1 root     root        4,  78 Jan  1  1970 ttyS14
    crw-rw-rw-    1 root     root        4,  79 Jan  1  1970 ttyS15
    crw-rw-rw-    1 root     root        4,  66 Jan  1  1970 ttyS2
    crw-rw-rw-    1 root     root        4,  67 Jan  1  1970 ttyS3
    crw-rw-rw-    1 root     root        4,  68 Jan  1  1970 ttyS4
    crw-rw-rw-    1 root     root        4,  69 Jan  1  1970 ttyS5
    crw-rw-rw-    1 root     root        4,  70 Jan  1  1970 ttyS6
    crw-rw-rw-    1 root     root        4,  71 Jan  1  1970 ttyS7
    crw-rw-rw-    1 root     root        4,  72 Jan  1  1970 ttyS8
    crw-rw-rw-    1 root     root        4,  73 Jan  1  1970 ttyS9
    crw-r--r--    1 root     root        1,   9 Jan  1  1970 urandom
    crw-r--r--    1 root     root       10, 130 Jul 10 08:30 watchdog
    crw-rw-rw-    1 root     root        1,   5 Jan  1  1970 zero
    Last edited by Vincenet; 07-17-2017 at 08:50 AM. Reason: adding question 2 and 3

  2. #2
    I have a remote teensy using Yun and find the following error:
    Code:
    Aug  2 15:21:19 dragino-16c830 kern.info kernel: [ 1590.970000] usb 1-1.3: USB disconnect, device number 44
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.460000] usb 1-1.3: new full-speed USB device number 45 using ehci-platform
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.570000] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.570000] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.570000] usb 1-1.3: Product: USB Serial
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.570000] usb 1-1.3: Manufacturer: Teensyduino
    Aug  2 15:21:20 dragino-16c830 kern.info kernel: [ 1591.580000] usb 1-1.3: SerialNumber: 3133110
    Aug  2 15:21:56 dragino-16c830 kern.info kernel: [ 1628.090000] usb 1-1.3: USB disconnect, device number 45
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.580000] usb 1-1.3: new full-speed USB device number 46 using ehci-platform
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.690000] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.690000] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.690000] usb 1-1.3: Product: USB Serial
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.700000] usb 1-1.3: Manufacturer: Teensyduino
    Aug  2 15:21:57 dragino-16c830 kern.info kernel: [ 1628.700000] usb 1-1.3: SerialNumber: 3133110
    The usb seems enumerating continuously. Any idea of this error? Is it more software or hardware problem? I already met one time and solve after many unplug and reset and it was already not clear. I have somebody who is going to unplug / re plug connexions.
    Regards,

    edit: this behaviour seems starting after teensy programming.
    Last edited by Vincenet; 08-02-2017 at 05:43 PM.

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,995
    Pehraps your sketch is constantly rebooting due to an error ?
    I'd try to connect the Teensy to a PC first.

    For YUN questions, this is the wrong forum, i think..

  4. #4
    The teensy_loader_cli tool seems working correctly but the teensy program seems not running after that. Reboot the host does not help.
    Disabling Yun Brigde feature in the sketch seems work around this problem. I will try arduino Yun forum.

    edit: I think period of usb disconnecting is same as my WD period. So it could confirm program is blocking when setting the bridge.
    Last edited by Vincenet; 08-02-2017 at 06:48 PM.

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,995
    Quote Originally Posted by Vincenet View Post
    The teensy_loader_cli tool seems working correctly but the teensy program seems not running after that. Reboot the host does not help.
    Disabling Yun Brigde feature in the sketch seems work around this problem. I will try arduino Yun forum.

    edit: I think period of usb disconnecting is same as my WD period. So it could confirm program is blocking when setting the bridge.
    I'd make the Teensy program run at first. With a PC.
    One problem less as soon it works..

    Rule#1 : Keep it simple.

    You can add the YUN after that - It's more easy if you know that the Teensy part is OK.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,785
    Judging only from that log, it looks like Teensy was plugged in at 1590 seconds, ran without any error for 37 seconds, then disconnected and immediately reappeared.

    A wild guess might look like just barely enough power available??

  7. #7
    Quote Originally Posted by PaulStoffregen View Post
    it looks like Teensy was plugged in at 1590 seconds, ran without any error for 37 seconds
    I suspected first yun extension or power monitor chip with I2C interface. Thinking one of them blocking at initialisation step. I build similar setup to investigate more (the other is in other place). I cannot met any error concerning this second system. Concerning the first one, I disabled, in a first time, Yun and I2C power monitor features. The system was working well. Enabling again after few days, it seems I have strange measurement with I2C power monitor saturating 32V instead of 12V expected.

    I just did an other test on second system at home:
    Adding long delay before ina219.begin(); (the I2C power monitor) it results behaviour with USB disconnect each 43 sec. be the cause of WD reboot.
    Adding long delay before Bridge.begin(); (related to the Yun) it results behaviour with USB disconnect each 37 sec. be the cause of WD reboot.
    So it confirms more the Yun fail.
    In real bug case, I know Yun reboot command did not help but a restart using powering off the whole system helps until it bugs again after teensy programming command from Yun.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •