On Thursday, May 11, 2017 at 5:05:14 PM UTC-7, Stef Mientki wrote:
>
> Hello,
>
>
>
> 3 years ago I made a web2py site, which has run on a Raspberry Pi without
> any problems since 3 years.
>
> I now want to replace the Raspberry Pi with a Raspberry Pi Zero
> (larger/faster).
>
>
>
> I haven't used web2py for 3 years and thought simply installing a new
> web2py and moving the application files would do the job, but unfortunately
> this isn't enough.
>
> But it wasn't that easy.
>
> Probably something has changed and I can't find what's the crucial
> difference.
>
>
>
> The problem is in the service calls to get dynamic data in graphs
> (dygraphs).
>
>
>
> Old Web2py on the Raspberry Pi = version 2.9.5
>
>
>
> I've tried 2 situations, which both give the same problem:
>
> Windows 10: version 2.14.6
>
> Raspberry: version 1.99 (the official version from Raspberry?)
>
> This surprises me, because one version is older and the other one is
> newer, still the give the same problems.
>
> Should I mess with routes or something like that ?
>
>
>
> #************************************************************
>
> In ../controllers/default.py
>
> #************************************************************
>
> from gluon.tools import Service
>
> service = Service(globals())
>
>
>
> def call():
>
> ##session.forget()
>
> return service()
>
>
>
> @cache('service_platdak_cache', cache_time_short, cache.ram )
>
> def service_platdak_cache():
>
>
>
> # Build the list of data samples here
>
> Rows = []
>
> Rows.append (...)
>
> Rows.append (...)
>
> Rows.append (...)
>
>
>
> return Rows
>
>
>
> @service.csv
>
> def service_platdak():
>
> return service_platdak_cache()
>
>
>
>
>
> #************************************************************
>
> In ../views/default/index.html
>
> I call the service
>
> #************************************************************
>
> <div id="pygraph2" style="clear:both; width:600px; height:330px;"></div>
>
> <script type="text/javascript">
>
> graph2 = new Dygraph(
>
> document.getElementById ( "pygraph2" ),
>
> "../call/csv/service_platdak",
>
> {
>
> customBars : false,
>
> title : 'Platdak: Inkomsten / Uitgaven =
> {{=response.Inkomsten_Platdak}}',
>
> legend : 'follow',
>
> ….
>
> }
>
> );
>
> </script>
>
> </div>
>
>
>
>
>
> #************************************************************
>
> Now if I ask the service in a browser
>
> http://127.0.0.1:8000/SolarPower_Molenhoek/call/csv/service_platdak
>
> I get:
>
> invalid controller (call/csv)
>
>
>
> If I ask for index.html in a browser, I don’t see any graphs.
>
> If I look in the debug screen of the browser, I see
>
> http://127.0.0.1:8000/SolarPower_Molenhoek/call/csv/service_platdak 404
> (NOT FOUND)
>
>
>
>
>
> Does anyone has a clue what's the problem/
>
>
>
> Thanks, Stef
>
>
>
3 years isn't that many versions back (we've been at 2.14.6 for a couple of
years as the Py3 push has slowed updates), and there shouldn't be too many
differences back to 2.11 (which should cover your original use).
This seems to be a routing issue (app/controller/function stuff) ... were
you using a router configuration in your original? Or did you change the
controller file from default.py?
/dps
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.