OpenWrt Forum Archive

Topic: Update on Linksys WRT1900AC support

The content of this topic has been archived between 16 Sep 2014 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

2 questions:

1) How many steps are programmed for the fan? like 100%, 66%,33%,0%?

2) How does the Interval variable work? I thought cron ran every 1 minute and it was unable to run less than a minute without a workaround.

Thanks

1) The script only has 3 steps it attempts to acheive off, 50% and 100%

2) Set the script to run at startup not as a cron script and the script will run every 5 seconds at its current value and then sleep for the specified interval time

JimWright wrote:

your sleep/wait wasn't being processed correctly,

You need "wait %1" or the processes will fill up with the sleep process. Check your processes.

Endless loop sad

(Last edited by gufus on 5 Jun 2015, 21:02)

This will be my first true "code submission" to a large open source project. I have tried my hand at writing a script for the WRT1900AC v1 that will allow for expansion in the future. In other words I look forward to greater granularity over the fan, my script is design to accommodate the “steps” as they become available. I took a rather radical look at how the fan should be controlled and saw that the system might work better if there were 2 scripts controlling the fan. The first script runs a basic command to check the temperatures and determines if it should call the second script that will determine the speed of the fan.

fan_state.sh

#!/bin/sh

CPU_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input`

CPU_MAXIMUM=50

if [[ $CPU_TEMP -g CPU_MAXIMUM ]]; then
  sh . ~/path/to/fan_ctrl.sh
  #could we check if it ended? such that cron does not keep
  #recalling this script until fan_ctrl ends.
  #syslogs to report it ran, maybe?
fi

exit 0    

Edit: I wrote this overnight while at a friend's house so I just realized this is a repeat effort as the second script. However I still believe that cron has an important role to play in this effort.

fan_ctrl.sh

#!/bin/sh
# Fan Control written by Lifehacksback

# Checks if Path to fan exists and determins if you are running kernel 3.18
# or 4.0. Set Path to pwm fans to $FAN_CTRL

if [ -d /sys/devices/pwm_fan ];then
    FAN_CTRL=/sys/devices/pwm_fan/hwmon/hwmon0/pwm1
elif [ -d /sys/devices/platform/pwm_fan ];then
    FAN_CTRL=/sys/devices/platform/pwm_fan/hwmon/hwmon0/pwm1
else
    exit 0
fi

# Initializing variales. CPU_MAX is the threshold, loopCtrl manages
# the while loop, and i manages the cases.

CPU_MAX=50
loopCtrl=true
i=0

# Temperature reading and logic happens here

while [[ loopCtrl==true ]]; do

    #Initializes variables with a double digit reading in Celsius

    CPU_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input`
    DDR_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp1_input`
    WIFI_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp2_input`

    #Finds the largest temperature and sets it to Largest

    Largest=$CPU_TEMP
    if [ $DDR_TEMP -gt $Largest ]; then
            Largest=$DDR_TEMP
    fi
    if [ $WIFI_TEMP -gt $Largest ] then
            Largest=$WIFI_TEMP
    fi

    #Logic
  if [[ ($Largest -ge $CPU_MAX) && ($i -le "2") ]]; then
    case $i in
      0 )
          echo 255 > $FAN_CTRL
        ;;
      1 )
          echo 100 > $FAN_CTRL
        ;;
      2 )
          echo 0 > $FAN_CTRL
          loopCtrl=false
        ;;
    esac
  else
    CPU_MAX="$[$CPU_MAX-"5"]"
    i=”$[$i+”1”]”
  fi
  sleep 2
done

exit 0

As you can see cases were used such that in a later point in time more can be easily added in order to improve fan speed and noise reduction. FYI I have not yet tested this code in the router but please review and comment!

(Last edited by lifehacksback on 5 Jun 2015, 16:47)

Is the fan a ball-bearing fan?

Anyone have the specifications.

lifehacksback wrote:

This will be my first true "code submission" to a large open source project. I have tried my hand at writing a script for the WRT1900AC v1 that will allow for expansion in the future. In other words I look forward to greater granularity over the fan, my script is design to accommodate the “steps” as they become available. I took a rather radical look at how the fan should be controlled and saw that the system might work better if there were 2 scripts controlling the fan. The first script runs a basic command to check the temperatures and determines if it should call the second script that will determine the speed of the fan.

fan_state.sh

#!/bin/sh

CPU_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input`

CPU_MAXIMUM=50

if [[ $CPU_TEMP -g CPU_MAXIMUM ]]; then
  sh . ~/path/to/fan_ctrl.sh
  #could we check if it ended? such that cron does not keep
  #recalling this script until fan_ctrl ends.
  #syslogs to report it ran, maybe?
fi

exit 0    

Edit: I wrote this overnight while at a friend's house so I just realized this is a repeat effort as the second script. However I still believe that cron has an important role to play in this effort.

fan_ctrl.sh

#!/bin/sh
# Fan Control written by Lifehacksback

# Checks if Path to fan exists and determins if you are running kernel 3.18
# or 4.0. Set Path to pwm fans to $FAN_CTRL

if [ -d /sys/devices/pwm_fan ];then
    FAN_CTRL=/sys/devices/pwm_fan/hwmon/hwmon0/pwm1
elif [ -d /sys/devices/platform/pwm_fan ];then
    FAN_CTRL=/sys/devices/platform/pwm_fan/hwmon/hwmon0/pwm1
else
    exit 0
fi

# Initializing variales. CPU_MAX is the threshold, loopCtrl manages
# the while loop, and i manages the cases.

CPU_MAX=50
loopCtrl=true
i=0

# Temperature reading and logic happens here

while [[ loopCtrl==true ]]; do

    #Initializes variables with a double digit reading in Celsius

    CPU_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input`
    DDR_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp1_input`
    WIFI_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp2_input`

    #Finds the largest temperature and sets it to Largest

    Largest=$CPU_TEMP
    if [ $DDR_TEMP -gt $Largest ]; then
            Largest=$DDR_TEMP
    fi
    if [ $WIFI_TEMP -gt $Largest ] then
            Largest=$WIFI_TEMP
    fi

    #Logic
  if [[ ($Largest -ge $CPU_MAX) && ($i -le "2") ]]; then
    case $i in
      0 )
          echo 255 > $FAN_CTRL
        ;;
      1 )
          echo 100 > $FAN_CTRL
        ;;
      2 )
          echo 0 > $FAN_CTRL
          loopCtrl=false
        ;;
    esac
  else
    CPU_MAX="$[$CPU_MAX-"5"]"
    i=”$[$i+”1”]”
  fi
  sleep 2
done

exit 0

As you can see cases were used such that in a later point in time more can be easily added in order to improve fan speed and noise reduction. FYI I have not yet tested this code in the router but please review and comment!

If I am reading the script correctly if the Largest temperature is tested at CPU_MAX = 35 (third try) and i > 2 then I believe the script will be in an endless loop since the loopCtrl will never get set to false.  I know we don't expect the Largest temperature to be lower than 40, but you may want to add an exit strategy when the condition goes the else statement 3 times and i is greater than 2.

Hi there,

A big thanks to everyone I've seen contributing to this WRT1200/1900 support. I received mine 2 days ago, and am now able to have almost everything functionnal vs. an old Backfire/WRTG54L build it's meant to replace.
In those days of crazy UI changes (MS, I'm looking at you), it's really good to see CC is almost similar to Backfire.

Quick one, after a lot of search and wiki scanning: I need to setup VLANs on my WRT1200AC for the 2 SSIDs of the wifi networks and I'm super confused about the "options 'ports'" params.
Back in the days of WRTG54, there were some mapping of physical ports to logical openwrt ports but obviously, things have changed with this Marvel chipset.

Can anyone post a 1200 network setup of a successfull VLAN setup ? Is it still needed to have tagging on the CPU (which port, used to be 5 on WRG54L). Also, what is the mapping between physical LAN ports (1 to 4) and ports as per the "option 'ports'" keywords.

For example, I need to have 2 interfaces, one for VLAN 2 and one for VLAN 3 on port 4 of the WRT1200. They'l then be part of different vswitches. How do you achieve this ?

regadpellagru wrote:

Can anyone post a 1200 network setup of a successfull VLAN setup ?

if i'm not mistaken, there's no switch support for the wrt1200ac, yet... maybe Kaloz knows more?

Need help reflashing firmware. I have ttl to usb. Is there a windows writeup I can follow? I have the ttl connected but nothing on putty loads. Also I see on some writeups that theres only 3 wires connected and on others there is 4? I tried tftpd32 but dont understand what settings to change. Can someone help me out?

@NeoMarz2020

https://github.com/Chadster766/McWRT/wi … erial-Port

Also make sure you set putty to the same com port your USB adapter is installed on (checked windows device manager)

In any case, a firwmare flash via the serial interface is only needed if you have bricked the router and the gui is not coming up.

(Last edited by alirz on 5 Jun 2015, 21:07)

I set putty to serial 115200 on com 3 but when i hit open i get a console that i cannot type in? My wrt is bricked (flashed the wrong firmware) why would the console not let me type? Am i even connected? My ip4 is set to 192.168.1.20 also

Do you see any text in putty? output from the router?
power cycle the router while the ttl is connected. If all the ttl pins are connected, you will see out put in putty. Pins to connect are 1,2 and 4 as seen in the picture at the above link.
You should see some text in putty regardless of IPs. The IPs are not in play yet, thats the next step.

is your usb ttl adapter installed on com3 that you are are specifying com 3 in putty?

(Last edited by alirz on 5 Jun 2015, 21:20)

NeoMarz2020 wrote:

I set putty to serial 115200 on com 3 but when i hit open i get a console that i cannot type in? My wrt is bricked (flashed the wrong firmware) why would the console not let me type? Am i even connected? My ip4 is set to 192.168.1.20 also

Check your connections, both-ends

ok i got it rec on putty. im at Marvell>> [D how can i upload the firmware now? I tried to use Tftp but keep getting cannot open img file.

NeoMarz2020 wrote:

ok i got it rec on putty. im at Marvell>> [D how can i upload the firmware now? I tried to use Tftp but keep getting cannot open img file.

Are you using TFTPD32 / 64

If so put the *.img in it's installed directory

I am running 64 but have it installed in the directory. I have tftpd32 open with server interface on 192.168.1.20 and current dir set to tftpd32 folder. When I run marvell commands i get this on reboot of the router

FPU initialized to Run Fast Mode.
USB 0: Host Mode
USB 1: Host Mode
USB 2: Device Mode
Modules Detected:
mvEthE6171SwitchBasicInit finished
Net:   mvSysNetaInit enter
set port 0 to rgmii enter
set port 1 to rgmii enter
egiga0 [PRIME], egiga1
modify Phy Status
auto_recovery_check changes bootcmd: run nandboot
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0xa00000, size 0x400000
4194304 bytes read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Marvell>>

(Last edited by NeoMarz2020 on 5 Jun 2015, 21:55)

*.img names and IP'S MUST ALL MATCH

run
Marvell>> setenv firmware_name openwrt.img
Marvell>> setenv ipaddr 192.168.200.1
Marvell>> setenv serverip 192.168.200.20
Marvell>> run flash_both_images

OK i have my ethernet ip4 set to 192.168.1.20 /sub 255.255.255.0 / gateway 192.168.1.1  Next Tftpd32 server interface set to 192.168.1.20, tftp bind to 192.168.1.20/ dhcp ip pool start add: 192.168.1.20, size of pool 20 also binded to 192.168.1.20

I also have rename the firmware to openwrt.img in the tfptd32 dir folder

Here is the output

Marvell>> setenv firmware_name openwrt.img
Marvell>> setenv ipaddr 192.168.1.1
Marvell>> setenv serverip 192.168.1.20
Marvell>> run flash_both_images
## Error: "flash_both_images" not defined
Marvell>> run flash_both_images
## Error: "flash_both_images" not defined
Marvell>> run flash_pri_image
mvNetaSpeedDuplexSet
Using egiga0 device
TFTP from server 192.168.1.20; our IP address is 192.168.1.1
Filename 'openwrt.img'.
Load address: 0x2000000
Loading: #
done

NAND erase: device 0 offset 0xa00000, size 0x4000000
Erasing at 0x49e0000 -- 100% complete.
OK

NAND write: device 0 offset 0xa00000, size 0x1e00000
31457280 bytes written: OK
Marvell>>

no need to bind interface etc.. Just set the directory to where you put the .img file and use previous poster's exact steps, matching the .img file name.

NeoMarz2020 wrote:

OK i have my ethernet ip4 set to 192.168.1.20 /sub 255.255.255.0 / gateway 192.168.1.1  Next Tftpd32 server interface set to 192.168.1.20, tftp bind to 192.168.1.20/ dhcp ip pool start add: 192.168.1.20, size of pool 20 also binded to 192.168.1.20

I also have rename the firmware to openwrt.img in the tfptd32 dir folder

Here is the output

Marvell>> setenv firmware_name openwrt.img
Marvell>> setenv ipaddr 192.168.1.1
Marvell>> setenv serverip 192.168.1.20
Marvell>> run flash_both_images
## Error: "flash_both_images" not defined
Marvell>> run flash_both_images
## Error: "flash_both_images" not defined
Marvell>> run flash_pri_image
mvNetaSpeedDuplexSet
Using egiga0 device
TFTP from server 192.168.1.20; our IP address is 192.168.1.1
Filename 'openwrt.img'.
Load address: 0x2000000
Loading: #
done

NAND erase: device 0 offset 0xa00000, size 0x4000000
Erasing at 0x49e0000 -- 100% complete.
OK

NAND write: device 0 offset 0xa00000, size 0x1e00000
31457280 bytes written: OK
Marvell>>


Marvell>> run update_both_images

(Last edited by gufus on 6 Jun 2015, 00:06)

regadpellagru wrote:

Hi there,

A big thanks to everyone I've seen contributing to this WRT1200/1900 support. I received mine 2 days ago, and am now able to have almost everything functionnal vs. an old Backfire/WRTG54L build it's meant to replace.
In those days of crazy UI changes (MS, I'm looking at you), it's really good to see CC is almost similar to Backfire.

Quick one, after a lot of search and wiki scanning: I need to setup VLANs on my WRT1200AC for the 2 SSIDs of the wifi networks and I'm super confused about the "options 'ports'" params.
Back in the days of WRTG54, there were some mapping of physical ports to logical openwrt ports but obviously, things have changed with this Marvel chipset.

Can anyone post a 1200 network setup of a successfull VLAN setup ? Is it still needed to have tagging on the CPU (which port, used to be 5 on WRG54L). Also, what is the mapping between physical LAN ports (1 to 4) and ports as per the "option 'ports'" keywords.

For example, I need to have 2 interfaces, one for VLAN 2 and one for VLAN 3 on port 4 of the WRT1200. They'l then be part of different vswitches. How do you achieve this ?

I'm not trying to get into your business, but why do you think you need VLANS, and especially VLAN Trunking? Is this router/switch going to be in a business setting where it's connected to other switches that share the same VLAN ID's?

I do know the stock Linksys image does allow VLANS for the outside interface, and inside interface 3 and 4. So, you may start there until switching is supported on OpenWRT.

Best Regards,

I can SSH into the router, but Filezilla throws this error:

Status:    Verbinden met 192.168.1.1...
Antwoord:    fzSftp started, protocol_version=2
Opdracht:    open "root@192.168.1.1" 22
Opdracht:    Pass: *******
Status:    Connected to 192.168.1.1
Fout:    Received unexpected end-of-file from SFTP server
Fout:    Kan niet verbinden met server

This is the log:

Sat Jun  6 00:11:01 2015 authpriv.info dropbear[3238]: Child connection from 192.168.1.194:51029
Sat Jun  6 00:11:02 2015 authpriv.notice dropbear[3238]: Password auth succeeded for 'root' from 192.168.1.194:51029
Sat Jun  6 00:11:02 2015 authpriv.info dropbear[3238]: Exit (root): Exited normally
Sat Jun  6 00:11:02 2015 authpriv.warn dropbear[3238]: Couldn't set SO_PRIORITY (Bad file descriptor)

I'm running Chaos Calmer 15.05-rc1.

(Last edited by Nikotine on 6 Jun 2015, 01:36)

davidc502 wrote:

I'm not trying to get into your business, but why do you think you need VLANS, and especially VLAN Trunking? Is this router/switch going to be in a business setting where it's connected to other switches that share the same VLAN ID's?

I do know the stock Linksys image does allow VLANS for the outside interface, and inside interface 3 and 4. So, you may start there until switching is supported on OpenWRT.

Best Regards,

Hi david,

I need Vlans because the legacy setup is about having, up to the router, from another non-openwrt AP, a long cable carrying the secured internal WIFI LAN over VLAN 2 and the unsecured guest WIFI LAN over VLAN 3. That's to cover the whole house with the 2 WIFI networks ...
I'm not gonna die if the feature is not here today, as this new gen router has quite more WIFI coverage, thanks to 802.11n (vs. 802.11g) but from a security perspective, it would make sense, as a target situation.

As I understand, It may not be here today, but possibly tomorrow ? Any input is welcome.

PS: got 5GHz and multi-sid working now.

I've installed luci-theme-openwrt because I like that theme a lot more than the default one, but after a few clicks, the pages suddenly look plain text:
http://imgur.com/3A10EYC

Nikotine wrote:

I've installed luci-theme-openwrt because I like that theme a lot more than the default one, but after a few clicks, the pages suddenly look plain text:
http://imgur.com/3A10EYC

I noticed that as well when I tried the RC build (I switched back to the snapshot build because of kernel updates).  It's actually a far cleaner look and I like it quite a bit more than the 90's color scheme, however after I a couple of save and applies it reverted back to the regular color scheme (which was a bit odd).

If the RC build OpenWRT theme isn't supposed to display like that, it would be awesome if someone could create a new version of the OpenWRT theme that mirrors the RC build.

Sorry, posts 5426 to 5425 are missing from our archive.