# Plugging new modules in

**URL:** <https://forums.pimoroni.com/t/plugging-new-modules-in/2884>\
**Category:** Flotilla\
**Created:** [August 19, 2016, 12:08pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884 "2016-08-19T12:08:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ucb](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/ucb/32/1476_2.png) [@ucb](https://forums.pimoroni.com/u/ucb)\
**Post date:** [August 19, 2016, 12:08pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884/1 "2016-08-19T12:08:55Z")

</div>

Can I just plug modules in and out with the dock plugged in?

The reason I ask is that I plugged in the light module (with the weather module already plugged in), and ran into this: [https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239](https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239) (shortened, but that’s the behaviour)

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [August 19, 2016, 12:17pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884/2 "2016-08-19T12:17:41Z")

</div>

You’re calling `c.available` and that’s returning a list, but then you’re accessing `c` directly to try and access a member of that list. Try, for example:

`l = c.available()['four']`

---

<div class="post-metadata">

**Author:** ![ucb](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/ucb/32/1476_2.png) [@ucb](https://forums.pimoroni.com/u/ucb)\
**Post date:** [August 19, 2016, 12:19pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884/3 "2016-08-19T12:19:23Z")

</div>

I think even if I get the light module via c.first(flotilla.Light) I get the same behaviour. I’ll try again and report.

Thanks for the quick reply.

---

<div class="post-metadata">

**Author:** ![ucb](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/ucb/32/1476_2.png) [@ucb](https://forums.pimoroni.com/u/ucb)\
**Post date:** [August 19, 2016, 12:25pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884/4 "2016-08-19T12:25:09Z")

</div>

Ok, if I get the module via `c.available['four']` it seems to work (hot plugging and unplugging), so it was me trying to wrongly get the module.

Having said that, it’s odd that the client would throw such a fit when you use it the wrong way, i.e. [https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239#file-light-py-L13-L23](https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239#file-light-py-L13-L23) ?

---

<div class="post-metadata">

**Author:** ![ucb](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/ucb/32/1476_2.png) [@ucb](https://forums.pimoroni.com/u/ucb)\
**Post date:** [August 20, 2016, 7:25pm UTC](https://forums.pimoroni.com/t/plugging-new-modules-in/2884/5 "2016-08-20T19:25:01Z")

</div>

So, I figured out why the client was complaining.

I have collectd running my python script every 1 minute. As I was investigating things, in a python repl, the script got run (by collectd) while I had a client in my repl. I can reproduce this behaviour, so I reckon that was it.
