2

i'm looking to do something maybe not that common with my Rpi; I have a rowing machine and I want to connect it to my Pi to motivate me to do sport. To do this, I have an Arduino connected to a Pi with 433 Mhz radios which sends every move done by the user on the rowing machine (with a code to identify the user which is rowing (he chooses with buttons connected to the Arduino)). All that stuff works, I receive the moves on the RPi in a Python soft.

Yet, I want to turn my Raspi in a captive portal with sessions. It won't be the classical workflow though: there will be no payement but every move on the rowing machine will unlock bandwidth for the user (it's, I think, the best way to force me to do sport!). So to do this, I thought CoovaChilli will be the best because it's open-source, based on a worthly project (ChilliSpot) and has a JSON Api that I could access through my Python Script.

To summary and illustrate, here is the workflow I'm working on: enter image description here

But I still have questions:

  • Does someone already experimented it on Raspi?
  • Can we use the API a bit more accurately, is there method like controller.setMaxSpeed()?
  • In the JSON Api doc, there is a quote which worries me (below), is it really not implemented or the doc is only not up-to-date?

maxTotalOctets ChilliSpot-Max-Total-Octets (not yet)

  • Did I miss something? Is there a perfect other open-source soft which fits my need?
  • Would it be complicated to build just with a Py webserver and no extra soft? (maybe with a py script acting like a proxy which measures internet consumption).
1

CoovaChilli on its own doesn't have enough user management capabilities to track utilisation properly. Whatever "state" you set for a particular session would get lost once that session terminates (disconnect, device reboot, etc.)

You may find more flexibility in doing user/bandwidth/capacity management using RADIUSdesk (which also has a JSON API), then getting CoovaChilli - or your captive portal of choice - to use RADIUSdesk as its authentication source.

RADIUSdesk leverages FreeRADIUS and MySQL, adding some of its own logic and tables, which should suit what you'd like to do quite well and avoids re-inventing quite a few wheels.

I've been unable to find confirmed references of RADIUSdesk-on-Pi, but some have tried, and all the sub-components are supposed to work on Pi. Unfortunately I do not have access to a Pi at the moment to confirm myself - worst-case, you'd need to run FreeRADIUS and MySQL externally, but I'm hopeful you wouldn't need to.

  • Hi, thanks for your answer. It looks like a very complete solution and it's also maybe overkilling the problem. Moreover, it's also not optimal if I've to battle to install it on a Pi (I guess you know that it's never running out of the box). But I got another idea: maybe if you play directly with the iptables (with the --quota option) set static IP addresses to the client: it should work. But your solution is much more qualitative and flexible than mine; the question is "will I have enough time to implement it?"! – Laurent Meyer Jan 10 '15 at 9:15
  • BTW not enough rep to upvote you but I'm doing it ASAP (it's on my TODO list) – Laurent Meyer Jan 10 '15 at 9:16
  • NP, I joined simply to try & promote a solution I've found to work well and hopefully help in the process :) If you do go this route, I would suggest downloading the RADIUSdesk VM, getting it working there, then retrofitting it onto the Pi. I'd tried getting CoovaChilli, MySQL and FreeRADIUS working seprately before, and wasted countless hours until I found the pre-packaged solution Dirk built. – Jannie H Jan 10 '15 at 19:30
  • Also, regarding CoovaChilli: as a complete novice on Raspbian, my approach to getting it working would be to deploy OpenWRT on it and install the CoovaChilli package as it's fairly "canned" and automatically includes all the networking bits needed for a captive portal, but that may well be purely because that's where my experience lies. You could also install the FreeRADIUS package to do the authentication, but there is no MySQL server package out the box; OpenWRT is primarily targetted at embedded systems, where flash wear is a concern and an RDBMS would be a no-no. – Jannie H Jan 11 '15 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.